cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
kschnarrs
Level II

Hide/exlude data for specific chart only

I'm trying to create a control chart that hides/excludes data for this chart only, and then another control chart that hides/excludes the inverse of that data. I've used the code below and it has worked on a previous graph (previously worked w/ graph builder), but does not seem to work on this graph (no data is hidden or excluded). I don't know if it could be because I'm now using Control Chart Builder (rather than graph builder), or if there is some other variable playing into it. Has anyone done this successfully or know what I might be able to try?

dt = Current Data Table();

dt << select where( :Category == "A" );

dt << Hide and Exclude;

dt << clear select;

dt << Control Chart Builder(

Automatic Recalc( 0 ),

.........

dt << select where( :Category == "A" );

dt << Hide and Exclude;

dt << clear select;

I don't want to have to create a subset of data because I'd need to create several sets and I want to keep everything central to one data set.

2 ACCEPTED SOLUTIONS

Accepted Solutions
ron_horne
Super User (Alumni)

Re: Hide/exlude data for specific chart only

hi kschnarrs

if i understood your request correctly you should be using the local data filter.

perhaps this example can help:

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

New Window( "Control Charts",

     V List Box(

          dt << Control Chart Builder(

              Variables( Y( :height ) ),

              Chart( Position( 1 ), Limits( Spec Limits( 1 ) ) ),

              Chart( Position( 2 ) ),

              Local Data Filter(

                   Location( {0, 18} ),

                   Add Filter( columns( :sex ), Where( :sex == "F" ) ),

                   Mode( Select( 0 ), Show( 1 ), Include( 1 ) )

              )

          ),

          dt << Control Chart Builder(

              Variables( Y( :height ) ),

              Chart( Position( 1 ), Limits( Spec Limits( 1 ) ) ),

              Chart( Position( 2 ) ),

              Local Data Filter(

                   Location( {0, 18} ),

                   Add Filter( columns( :sex ), Where( :sex == "M" ) ),

                   Mode( Select( 0 ), Show( 1 ), Include( 1 ) )

              )

          )

     )

);

best!

ron

View solution in original post

Re: Hide/exlude data for specific chart only

With the current implementation of the Control Chart Builder, labels for hidden an excluded points will always appear on the axis.  There has been a request to add this feature to Control Chart Builder, but it is not there yet.

View solution in original post

7 REPLIES 7
ron_horne
Super User (Alumni)

Re: Hide/exlude data for specific chart only

hi kschnarrs

if i understood your request correctly you should be using the local data filter.

perhaps this example can help:

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

New Window( "Control Charts",

     V List Box(

          dt << Control Chart Builder(

              Variables( Y( :height ) ),

              Chart( Position( 1 ), Limits( Spec Limits( 1 ) ) ),

              Chart( Position( 2 ) ),

              Local Data Filter(

                   Location( {0, 18} ),

                   Add Filter( columns( :sex ), Where( :sex == "F" ) ),

                   Mode( Select( 0 ), Show( 1 ), Include( 1 ) )

              )

          ),

          dt << Control Chart Builder(

              Variables( Y( :height ) ),

              Chart( Position( 1 ), Limits( Spec Limits( 1 ) ) ),

              Chart( Position( 2 ) ),

              Local Data Filter(

                   Location( {0, 18} ),

                   Add Filter( columns( :sex ), Where( :sex == "M" ) ),

                   Mode( Select( 0 ), Show( 1 ), Include( 1 ) )

              )

          )

     )

);

best!

ron

kschnarrs
Level II

Re: Hide/exlude data for specific chart only

That almost works, but using the Local data filter still shows all the x-axis labels for the excluded data and the remaining data on the chart is still spread leaving blanks for the excluded data (I'd like it to re-graph as if the excluded data had never existed).

Thanks for the help!

ian_jmp
Staff

Re: Hide/exlude data for specific chart only

If you don't assign a variable to the 'Subgroup' role, Control Chart Builder (CCB) will use the row in the table (hence the blanks).

You could try constructing an index variable for each level of the variable you assign to the local data filter. But note this is potentially misleading, in the sense that if you don't apply the filter you have defined, CCB will average between the levels to get the points it plots

kschnarrs
Level II

Re: Hide/exlude data for specific chart only

I'm not sure how to go about doing that...

Re: Hide/exlude data for specific chart only

With the current implementation of the Control Chart Builder, labels for hidden an excluded points will always appear on the axis.  There has been a request to add this feature to Control Chart Builder, but it is not there yet.

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Hide/exlude data for specific chart only

I'm not sure what goes wrong as I can only see parts of your code. Or I may have misunderstood completely. But to make the chart adapt to row-state changes, I would try to set AutomaticRecalc(0) to  AutomaticRecalc(1). 

kschnarrs
Level II

Re: Hide/exlude data for specific chart only

Changing the automatic recalc doesn't seem to make a difference. For example, below, everywhere there's a gap was a point A. when I'm filtering out these values, I don't want there to be a gap and a label for the point that is being excluded.

10924_pastedImage_0.png