Subscribe Bookmark RSS Feed

subset whole table regardless if a column is selected (not just subset columns selected)

bjbreitling

Community Trekker

Joined:

Dec 13, 2012

Hi Community,

If I subset selected rows and selected columns I get the selected columns and selected rows.  Is there away to get all the columns (selected or not) and only the selected row?  I have a button in a script for users to subset data with that's highlighted/selected, but they often will have clicked columns inadvertently and then don't subset the whole data table but only the selected columns (not there desire but the JMP code is built that way).  Below is the JSL for my subset button so if anyone can work within that code to get the desired that would be appreciated.

Regards,

tbl = Current Data Table();

runSubsetScript = Function(

  {df,tbl},

  wc = df << Get Where Clause;

  Eval(

  Substitute(

  Expr(

  tbl << Subset(

  whereClause,

  )

  ),

  Expr(whereClause),Parse(wc)

  )

  );

);

newWind = New Window(

  "Data Filter Example",

  df = tbl << Data Filter(

  Location( {58, 58} ),

  Mode( Show( 1 ), Include( 1 ) ),

  Add Filter( Columns( :Timestamp,:Plant ), Display( :Timestamp,:Plant ) )

  ),

  Button Box("Subset",runSubsetScript(df,tbl))

);

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

You can use two of Subset's optional arguments: selected rows () and selected columns ().

Insert these lines, including the comma, after the "whereClause," in your subset expression:

selected rows (1),

selected columns (0)

Cheers,

Brady

1 REPLY
Solution

You can use two of Subset's optional arguments: selected rows () and selected columns ().

Insert these lines, including the comma, after the "whereClause," in your subset expression:

selected rows (1),

selected columns (0)

Cheers,

Brady