I'm trying to understand working with objects that are containers of rows. Even that description may be incorrect.
What is "FilteredRows" in this context?
dt = Current Data Table();
FilteredRows = dt << get rows where( :Date == 12May2025 );
Show( N Rows( FilteredRows ) );
To back up slightly, is there a JSL command to set an object to ALL rows in a datatable? Or is that never necessary?
The closest I can find that avoids 'Select All Rows' is:
AllRows = dt << get rows where(1);
Feels like cheating though.
More importantly, I'd like to be able to apply additional filters to a subset of rows
This does not work, but conveys the intent:
XFilteredRows = dt << get rows where( :X == 42 );
XYFilteredRows = XFilteredRows << get rows where(:Y ==1.21);
Yes, I can do both in one line
XYFiteredRows = dt << get rows where(:X==42 & :Y==1.21);
However I plan to use this in a For Each Row loop, where X removes 99% of the rows, and I'll need to subsequently filter more parameters independently, i.e. rows that meet XY, and rows that meet XZ and rows that meet X but not Y, etc...
I believe it will be faster on large tables to keep the X filtered rows.
On a related note, one result I'm trying to get is very similar to the 'Group By' result, but with a custom formula.
JSL of a column formula:
Col Mean( :Parameter, :X )
'Group By' is very convenient for created column formula from built in functions, but when I want to do more complex math I don't know how to achieve the same grouping effect.