wks-col-filter
filter
wks.col.filter
wks.col.filter$
numeric
string
Read/write
Add or remove a filter. 0 = remove filter 1 = add filter 2 = custom filter (read only) Note: Filter properties are set by using these filter related scripts, but the filter will not run automatically, and the method wks.runfilter() needs to be called to run or re-apply the filter.
Set or get filter query string. It must set the filter type to advance.
EX1
newbook; col(1) = data(1,31); col(2)=uniform(31)*10+70; wks.col2.filter = 1; wks.col2.filterx$ = "temperature"; // variable name we will use wks.col2.filter$ = "temperature > 75"; // our filter condition wks.runfilter(); wks.col2.filter(); // open the associated filter dialog box to modify filter
EX2
wks.col.categorical.sort
// import automobile.dat to a new book fn$ = system.path.program$ + "Samples\Statistics\automobile.dat"; newbook; impASC fn$; // apply filter to column = Make to show only Buick Chrysler GMC Lincoln Saturn wks.col2.filter=1; wks.col2.filterx$ = make; wks.col2.filter$ = "make="Buick" or make="Chrysler" or make="GMC" or make="Lincoln" or make="Saturn""; wks.runfilter(); // set col(2) as categorical and sort in ascending order wks.col2.categorical.type=2; wks.col2.categorical.sort=1; //refresh column filter wks.runfilter(); // unstack worksheet to columns by make wunstackcol -r 2 irng1:=[%H]automobile!C"Power" irng2:=[%H]automobile!B"Make" nonstack:=1 other:=[%H]automobile!A"Year" extract:=0; // create stack plot of col(1) vs. col(2) to end, type=scatter plotstack iy:=(1,2:end) plottype:=scatter order:=0 link:=1 xlink:=1;
EX3
wks.col2.filter = 0; wks.runfilter(2); //force update even there is no filter
wks.col.filterx, wks.col.filter(method), wks.col.categorical.type, wks.col.categorical.sort