Trim end for LT dataset function in Set Column Values


Version: 2025b

Type: Features

Category: Data Handling

Subcategory: Worksheet

Jira: ORG-31343


If source data contains many missing/empty cells at the end, then define a LT funtion to return a range or a dataset, the result will also contains many missing/empty cells at the end. This will make book size too big.

Now, a new system variable @SCVE is added to default trim the ending empty cells.

  • Default = 1: Trim Empty

  • 2: Trim missing value “--”

  • 3: Trim both empty and missing

  • 0: Do not trim (old behavior like previous versions)

Example

Run script,

function dataset getValues(int jj)
{
	range r1 = wcol(jj);
	return r1;
}
newbook;
wks.nCols = 5;
col(A) = data(1,100);
csetvalue col:=col(B) formula:="if(i<10,A)";
csetvalue col:=col(C) formula:="if(i<10,A, NA())";
csetvalue col:=col(D) formula:="getValues(2)";
csetvalue col:=col(E) formula:="getValues(3)";

Will see that result in col(D) only contains 9 data cells now, while col(E) contains 100 data cells with lots of missing value at the end. Now you can set @SCVE to different value like 2 or 3, then change value in col(A) to recalculate to see the difference.