cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
djhanson
Level V

Data Table to Table Box (easier way?)

Does anyone know if there is a simpler way to convert a Data Table (with both char and numeric columns) into a Table Box display box?  The only way I see is by looping thru each data table column for both the char columns and numeric columns (i.e. StringColBox, NumberColBox).  I was just wondering if there was some elusive JSL command that would take all of the Data Table contents to pass to the Table Box command.  Maybe there is no way around making a Table Box without the separate StringColBox and NumberColBoxes I suppose?  Thoughts?  thx... dj

dt_Fruit :  "Fruit" (char), "Location" (char), "Fruit Yield" (numeric), "Fruit Price" (numeric)

TableBox(
     StringColBox("Fruit",fruitvalue),
     StringColBox("Location",locationvalue),

     NumberColBox("Fruit Yield",fruityieldvalue),
     NumberColBox("Fruit Price",fruitpricevalue)
);

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Data Table to Table Box (easier way?)

You can get a Table Box in one sweep via Journal()

close all(journals);

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

dt << journal;

New Window( eval(dt<<getname),  Current Journal()[TableBox(1)] );

// Clean up workspace

Current Journal()<<close window;


View solution in original post

2 REPLIES 2
djhanson
Level V

Data Table to Table Box (easier way?)

Ok, I did manage to simplify this a bit more (but if anyone sees an even easier way, please feel free to share!):

colNamesStr = dt_Fruit<<get column names(character, nominal);

colNamesNum = dt_Fruit<<get column names(numeric, continuous);

TableBox(
     StringColBox(char(colNamesStr[1]),colNamesStr[1]<<get values),
     StringColBox(char(colNamesStr[2]),colNamesStr[2]<<get values),

     NumberColBox(char(colNamesNum[1]),colNamesNum[1]<<get values),
     NumberColBox(char(colNamesNum[2]),colNamesNum[2]<<get values)
);

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

Re: Data Table to Table Box (easier way?)

You can get a Table Box in one sweep via Journal()

close all(journals);

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

dt << journal;

New Window( eval(dt<<getname),  Current Journal()[TableBox(1)] );

// Clean up workspace

Current Journal()<<close window;


Recommended Articles