Hi,
As Jeff mentions:
1) Add a new column to your table, name it "Selected", then right click on the column header, select Formula and enter this formula:
selected ( row state ( ) )
This formula results in the cell value == 1 when the row is selected, and 0 if not.
2) Right-click on the Selection column, select Column Properties, and change the modeling type to Nominal.
3) Build your graph with Graph Builder.
4) Use Tabulate to make a table with the statistics you want, using the Selected column as a grouping column.
5) In the Tabulate report, invoke a Local Data Filter, using the Selection column. Choose the 0 (zero) level, and click the "Inverse" checkbox. The reason for this is that the "1" level will not initially show up if there are no rows selected, so we use the "0" level and invert.
Now, the summary will reflect whichever rows are selected (no matter where you select them).
I've pasted a script below so you can see the result easily. The script creates a random table in which half of the rows are selected, a Graph Builder graph, and a Tabulate report with a Local Data Filter.
Cheers,
Brady
Names Default To Here(1);
dt = astable(J(20,2, randomuniform()));
dt << new column("Selected", nominal, formula(selected(row state())));
dt << select randomly (0.5);
dt << Graph Builder(
Size( 526, 454 ),
Show Control Panel( 0 ),
Variables( X( :Col2 ), Y( :Col1 ) ),
Elements( Points( X, Y, Legend( 2 ) ), Smoother( X, Y, Legend( 3 ) ) )
);
dt << Tabulate(
Show Control Panel( 0 ),
Add Table(
Row Table(
Analysis Columns( :Col1 ),
Grouping Columns( :Selected ),
Statistics( Sum, Mean )
)
),
Local Data Filter(
Show Histograms and Bars( 0 ),
Inverse( 1 ),
Add Filter( columns( :Selected ), Where( :Selected == 0 ) )
)
);