Subscribe Bookmark RSS Feed

Does anyone have an example of a 2 level Data Filter Context Box, where one platform subsets a second platform and that platform subsets the third display?

txnelson

Super User

Joined:

Jun 22, 2012

I am attempting to do a 2 stage filter where the selection of data from one displayed graph, subsets the display in a second graph, and then selecting from the second graph, subsets a third displayed graph.

10568_pastedImage_0.png

The above is a partially successful attempt.  The third display is a subset of selections from the first 2 displays, however, the second filter does not get properly subsetted by the first graph.  Below is the code for the above attempt:

Names Default To Here( 1 );

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

New Window( "Shared Local Filter",

Data Filter Context Box(

  H List Box(

   Data Filter Source Box(

    H List Box(

     Graph Builder(

      Size( 208, 207 ),

      Show Control Panel( 0 ),

      Show Legend( 0 ),

      Variables( X( :age ) ),

      Elements( Bar( X, Legend( 3 ) ) ),

      SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} ) )

     ),  

     Graph Builder(

      Size( 208, 207 ),

      Show Control Panel( 0 ),

      Show Legend( 0 ),

      Variables( X( :sex ) ),

      Elements( Bar( X, Legend( 3 ) ) ),

      SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} ) )

     )

    )

   ),

   Platform(

    Current Data Table(),

    Bubble Plot( X( :weight ), Y( :height ), Sizes( :age ), Title Position( 0, 0 ) )

   )

  )

)

);

I thought that I should be able to create a new Data Filter Context Box within the Platform for the first selection:

Names Default To Here( 1 );

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

New Window( "Shared Local Filter",

Data Filter Context Box(

  H List Box(

   Data Filter Source Box(   

    Graph Builder(

     Size( 208, 207 ),

     Show Control Panel( 0 ),

     Show Legend( 0 ),

     Variables( X( :age ) ),

     Elements( Bar( X, Legend( 3 ) ) ),

     SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} ) )

    )

   ),

   Platform(

    Current Data Table(),

    Data Filter Context Box(   

     Graph Builder(

      Size( 208, 207 ),

      Show Control Panel( 0 ),

      Show Legend( 0 ),

      Variables( X( :sex ) ),

      Elements( Bar( X, Legend( 3 ) ) ),

      SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} ) )

     ),  

     Platform(

      Current Data Table(),

      Bubble Plot( X( :weight ), Y( :height ), Sizes( :age ), Title Position( 0, 0 ) )

     )

    )

   )

  )

)

);

It does properly create the second filter, which is subsetted by the first filter, but the 3rd display is not displayed.

Does anyone have a solution for this.  I could write the code to regenerate and redisplay the charts upon detecting the changes, but I would rather use the Data Filter Context Box solution if one is possible?

Jim
1 ACCEPTED SOLUTION

Accepted Solutions
danschikore

Staff

Joined:

Sep 21, 2012

Solution

I'm glad that you found a solution.  Just to link things together, one of the documents with Selection Filter examples is Using Selection Filters in JMP 12.

Using your first example, I added a second Data Filter Source Box() to create the two-level filter:

Names Default To Here( 1 );

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

New Window( "Shared Local Filter",

       Data Filter Context Box(

              H List Box(

                     Data Filter Source Box(

                           H List Box(

                   Graph Builder(

                        Size( 208, 207 ),

                        Show Control Panel( 0 ),

                        Show Legend( 0 ),

                        Variables( X( :age ) ),

                        Elements( Bar( X, Legend( 3 ) ) ),

                        SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} ) )

                    ),

                                    Data Filter Source Box(

                        Graph Builder(

                            Size( 208, 207 ),

                            Show Control Panel( 0 ),

                            Show Legend( 0 ),

                            Variables( X( :sex ) ),

                            Elements( Bar( X, Legend( 3 ) ) ),

                            SendToReport(

                                Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} )

                            )

                        )

                    )

                )

            ),

                     Platform(

                           Current Data Table(),

                   Bubble Plot( X( :weight ), Y( :height ), Sizes( :age ), Title Position( 0, 0 ) )

           )

       )

    )

);

3 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

An example was found in the file exchange

Jim
danschikore

Staff

Joined:

Sep 21, 2012

Solution

I'm glad that you found a solution.  Just to link things together, one of the documents with Selection Filter examples is Using Selection Filters in JMP 12.

Using your first example, I added a second Data Filter Source Box() to create the two-level filter:

Names Default To Here( 1 );

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

New Window( "Shared Local Filter",

       Data Filter Context Box(

              H List Box(

                     Data Filter Source Box(

                           H List Box(

                   Graph Builder(

                        Size( 208, 207 ),

                        Show Control Panel( 0 ),

                        Show Legend( 0 ),

                        Variables( X( :age ) ),

                        Elements( Bar( X, Legend( 3 ) ) ),

                        SendToReport( Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} ) )

                    ),

                                    Data Filter Source Box(

                        Graph Builder(

                            Size( 208, 207 ),

                            Show Control Panel( 0 ),

                            Show Legend( 0 ),

                            Variables( X( :sex ) ),

                            Elements( Bar( X, Legend( 3 ) ) ),

                            SendToReport(

                                Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Filter" )} )

                            )

                        )

                    )

                )

            ),

                     Platform(

                           Current Data Table(),

                   Bubble Plot( X( :weight ), Y( :height ), Sizes( :age ), Title Position( 0, 0 ) )

           )

       )

    )

);

txnelson

Super User

Joined:

Jun 22, 2012

Dan,

It was your filtering File Exchange examples that I had discovered, that helped me solve the problem.

Thanks for following up.

Jim

Jim