cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
JensRiege
Level IV

Capturing selections made by a user using the local data filter in Graph Builder

I would like to be able to capture the selection made when a user selects a value using the local data filter for a Graph Builder object.

For example in the snippet below, if I selected "Apple" using the local data filter, how do I capture "Apple" in a variable so I can put it in a chart title.

Does this require the use of the row state handler? I have not used that before.  Thank you! -Jens

NamesDefaultToHere(1);
Clear Log();

// Some data
dt = New Table ( "Fruits", Add Rows( 3 ),
     New Column( "Fruit" , Character, "Nominal", Set Values( {"Pear", "Apple", "Orange"} ))
);

// A report with a local data filter
gb = dt << Graph Builder(Size( 528, 448 ),Show Control Panel( 0 ),Show Legend( 0 ),
     Variables( X  ( :Fruit ) ),
     Elements ( Bar( X, Legend( 3 ) ) ),
     Local Data Filter( Mode, Add Filter( columns( :Fruit ) ) )
);

// want to capture value of Local Data Filter selection into a variable
ldf_selection = ???
1 REPLY 1
txnelson
Super User

Re: Capturing selections made by a user using the local data filter in Graph Builder

Here is the entry from the Scripting Index that shows how to return the Where Clause used in the seleeellll

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = dt <<
local Data Filter(
	Add( Filter Columns( :Region, :Lead ) )
);
Wait( 1 );
obj << (Filter Column( :Lead ) <<
Where( :Lead >= .4 & :Lead <= 1.4 ));
txt = obj << get where clause;
Jim