How to retrieve tabulated values by scriptDear Community,
Based on the Tabulated output below, please how can I retrieve the amounts for categories 1, 2, 3 by script?

Based on qnother working script I`m currently there in my tries:
r = TabulateQuantiles << report;
tb_TabQuant = r[Table Box( 1 )];
tb_TabQuant << GetText;
QuantAmount1 = tb_TabQuant[2][1];
QuantAmount2 = tb_TabQuant[2][2];
QuantAmount3 = tb_TabQuant[2][2];
Show(QuantAmount1, QuantAmount2, QuantAmount3);
But getting following error:
Cannot subscript Display Box in access or evaluation of 'r[Table Box(1)]' , r[/*###*/Table Box( 1 )]
Thanks for your help!
ScriptingRe: How to retrieve tabulated values by scriptThis will put the values into a new table:
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
tab =
dt << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Grouping Columns( :age ) ),
Row Table( Analysis Columns( :height ), Statistics( Mean ) )
)
);
Wait(2);
dt2 = tab << makeIntoDataTable;
dt2 << setName("Tabulation from "||(dt << getName));
Re: How to retrieve tabulated values by scriptThanks a lot Ian,
The Tabulate Analysis does not behave like others thenm simply using [Table Box( i )] ...
Sorry, but i`m now struggling with retrieving the data from the data tablem and could not find it in the Scripting index:

Re: How to retrieve tabulated values by scriptYes, if you can avoid plucking values from the display tree that's usually a good strategy. If you want to get the values into variables, you can do something like this ('levels' will be a list, 'vals' a matrix):
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
tab =
dt << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Grouping Columns( :age ) ),
Row Table( Analysis Columns( :height ), Statistics( Mean ) )
)
);
dt2 = tab << makeIntoDataTable;
dt2 << setName("Tabulation from "||(dt << getName));
cols = dt2 << getColumnNames(:String);
RemoveFrom(cols, 1, 2);
dt3 = dt2 <<
Transpose(
columns(Eval(cols)),
Transpose selected rows only( 1 ),
Label( :Statistics ),
Output Table( (dt2 << getName) )
);
levels = Column(dt3, "Label") << getValues;
vals = Column(dt3, "Mean") << getValues;
Close(dt2, NoSave);
Close(dt3, NoSave);Re: How to retrieve tabulated values by scriptThanks again Ian,
That is obviously the complex way, but it would be usefull in case I need to retrieve whole columns I suppose;)
I finally managed after finding the right syntax in the OnLine help page:
tb_TabQuant = TabulateQuantiles << MakeIntoDataTable(Invisible);
//tb_TabQuant << setName("Tabulation from "||(dt << getName));
/*
QuantAmount1 = "24636";
QuantAmount2 = "1036";
QuantAmount3 = "257";
*/
QuantAmount1 = tb_TabQuant[1,1];
QuantAmount2 = tb_TabQuant[1,2];
QuantAmount3 = tb_TabQuant[1,3];
Show(QuantAmount1, QuantAmount2, QuantAmount3);The last blocking thing for my case wqs to convert these 3 values into stringsm which I managed using Char(number)
Cheers!
Have a great End of Year