BookmarkSubscribe
Choose Language Hide Translation Bar
fanienel
Community Trekker

Scripting "Save where clause" in a Data filter


Hi,

I would like to draw a histogram using a journal script with data selected previously using a Data Filter.  But I need to print the 'where clause' on the output. The "Save where clause" copies this manually. Is there a way of doing this in a script?

Thank you

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User ms
Super User

Re: Scripting "Save where clause" in a Data filter

df = dt << Data Filter;

// Save WHERE clause with any of the commands below

df << to Clipboard;

df << to Journal

df << to Row State Column;

df << to Data Table;

df << to Script Window;

View solution in original post

0 Kudos
4 REPLIES 4
ms
Super User ms
Super User

Re: Scripting "Save where clause" in a Data filter

df = dt << Data Filter;

// Save WHERE clause with any of the commands below

df << to Clipboard;

df << to Journal

df << to Row State Column;

df << to Data Table;

df << to Script Window;

View solution in original post

0 Kudos
fanienel
Community Trekker

Re: Scripting "Save where clause" in a Data filter

Thank you MS,

That was just what I needed.

0 Kudos
ian_jmp
Staff

Re: Scripting "Save where clause" in a Data filter

Not quite sure of your intended result, but perhaps something like this?

NamesDefaultToHere(1);

dt = Open("$SAMPLE_DATA/Big Class.JMP");

nw = NewWindow("Distribution with Where Clause",

  dist = dt << Distribution(

  Automatic Recalc( 1 ),

  Continuous Distribution( Column( :weight ) ),

  Nominal Distribution( Column( :age ) ),

  Invisible

  );

  );

ldf = dist << Local Data Filter( Mode, Add Filter( columns( :sex ), Where( :sex == "M" ) ) );

ldf << To Journal;

nw << Journal;

nw << CloseWindow;

Close(dt, NoSave);



0 Kudos
fanienel
Community Trekker

Re: Scripting "Save where clause" in a Data filter

Hi Guys

Is there a way to pass the where clause to a string variable?

Thanks

0 Kudos