Subscribe Bookmark RSS Feed

Extract data from a tabulation's tree structure?

pmroz

Super User

Joined:

Jun 23, 2011

In my quest to avoid the table-flashing behavior of JMP I'm trying a different approach.  Normally I create an invisible tabulation, and to use the data I make a data table out of it.  The data table is easy to use, but unfortunately if you create a lot of them (like I do) you get lots of tables appearing and disappearing. 

To prevent the table flashing I'd like to extract the data directly from the tabulation's tree structure.  I'm getting close but haven't found the right technique.

Here's an example:

dt = open("$sample_data\Big Class.jmp");

tb = Tabulate(

      Show Control Panel( 0 ),

      Add Table(

            Column Table( Grouping Columns( :sex ) ),

            Row Table( Grouping Columns( :age ) )

      )

);

This creates the following tabulation:

sex

age

F

M

12

5

3

13

3

4

14

5

7

15

2

5

16

2

1

17

1

2

To get the tree structure I use these commands:

rtb = tb << report;

rtb << show tree structure;

The relevant portion of the tree structure is here:

1177_Tree Structure.png
I want to extract the values from these three multitblnumcolboxen.  How do I do it?  This doesn't work:

age_list = rtb[multitblnumcolbox(1)] << Get values;

f_list   = rtb[multitblnumcolbox(2)] << get values;

f_list   = rtb[multitblnumcolbox(3)] << get values;

Get Items doesn't work either.  Thanks for any suggestions!

Peter

4 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

I got a little farther by using GET TEXT:

age_txt = rtb[multitblnumcolbox(1)] << Get Text;

f_txt   = rtb[multitblnumcolbox(2)] << Get Text;

m_txt   = rtb[multitblnumcolbox(3)] << Get Text;

I can parse these strings into lists

crlf     = hex to char("0D0A");

age_list = words(age_txt, crlf);

f_list   = words(f_txt, crlf);

m_list   = words(m_txt, crlf);

Is there a better, more direct way?

mattf

Community Trekker

Joined:

Jun 23, 2011

Hi:

Show Properties(tb); // reveals

tb << Make Into Data Table();

Best,

-Matt

pmroz

Super User

Joined:

Jun 23, 2011

Matt,

I know that I can make a data table from the tabulation.  The problem is that when I'm creating many tabulations + data tables (with tb << make into data table), there's a lot of flashing of tables on the screen.  I can create an invisible tabulation no problem.  However when I convert it to a table with tb << make into data table, I can't make an invisible table.  I build displays from the data in the data table, but I'd like to get the data without all the flashing going on.

Try this example and you'll see what I'm talking about.  I notice that the table "flashing" is much more pronounced in JMP 9 running on Windows XP.  It wasn't so bad in JMP 8.  Seems like separate window creation under Windows 7is "cheaper", hence it's faster.

dt = open("$sample_data/Semiconductor Capability.jmp");

tb1 = dt << Tabulate(

    Show Control Panel( 0 ),

    Add Table(

        Column Table( Grouping Columns( :SITE ) ),

        Row Table( Grouping Columns( :lot_id, :wafer ) )

    ), invisible

);

tab1_dt = tb1 << Make Into Data Table;

tb1 << close window;

tab1_dt << Minimize Window(1);

tb2 = dt << Tabulate(

    Show Control Panel( 0 ),

    Add Table(

        Column Table(

            Analysis Columns(

    :NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3, :IVP2, :NPN4,

    :SIT1, :INM1, :INM2, :VPM1, :VPM2, :VPM3, :PMS1, :SNM1, :SPM1, :NPN5,

    :EP2, :ZD6, :PBA, :PLG, :CAP, :PBA 2, :PLG 2, :PNP5, :NPN6, :PNP6,

    :PNP7, :NPN7, :PNP8, :IVP3, :IVP4, :IVP5, :IVP6, :PNP9, :NPN8, :NPN9,

    :IVP7, :NPN10, :N_1, :PBA1, :WPR1, :B10, :PLY10, :VBE210, :VTN210,

    :VTP210, :SIT2, :SIT3, :INV2, :INV3, :INV4, :INV5, :FST1, :FST2

            )

        ),

        Row Table( Grouping Columns( :Wafer ID in lot ID, :SITE ) )

    ), invisible

);

tab2_dt = tb2 << Make Into Data Table;

tb2 << close window;

tab2_dt << Minimize Window(1);

FWIW I'm running JMP 9.0.2 on a Lenovo T420 with 3 GB of RAM.  The processor is an Intel i5-2520M.  As I mentioned the operating system is Windows XP.

Regards,

Peter

mattf

Community Trekker

Joined:

Jun 23, 2011

Hmmm... Sounds like you need something like:

"newdt = tb << Make Into Data Table(invisible);"