Data Table to Table Box (easier way?)<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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)
);
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;
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<
colNamesNum = dt_Fruit<
TableBox(
StringColBox(char(colNamesStr[1]),colNamesStr[1]< StringColBox(char(colNamesStr[2]),colNamesStr[2]<),
NumberColBox(char(colNamesNum[1]),colNamesNum[1]<),
NumberColBox(char(colNamesNum[2]),colNamesNum[2]<)
);