- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to get Caption Box values in a datatable?
In the attached made up example data table the saved script plots the chart pasted below.
I would like to get the Caption Box values in a data table with TestStage numbers in the first column and the Caption Box Values in the second column. How to do this via JSL?
It would be even more useful if I could generate the data table dynamically, say from a button click in the graph builder window once I have selected the weeks via the Local Data Filter. Is this possible to do via JSL?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
You could use separate tabulate for that
Names Default To Here(1);
dt = Open("$DOWNLOADS/example_DataTable.jmp");
nw = New Window("",
Data Filter Context Box(
H List Box(
dt << Data Filter(Local,
Add Filter(
columns(:TestWk),
Modeling Type(:TestWk, Nominal),
Where(
:TestWk == {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}
),
Display(:TestWk, Find(Set Text("")))
)
),
V List Box(
gb = dt << Graph Builder(
Size(744, 332),
Show Control Panel(0),
Variables(X(:TestWk), Y(:Median), Group Y(:TestStage)),
Elements(
Points(X, Y, Legend(8)),
Caption Box(X, Y, Legend(10), Summary Statistic("N"))
),
SendToReport(Dispatch({}, "TestWk", ScaleBox, {Label Row(Show Major Grid(1))}))
),
tab2 = dt << Tabulate(Show Control Panel(0), Add Table(Column Table(Statistics(N))))
),
tab = dt << Tabulate(
Change Item Label(Statistics(N, "Die tested")),
Show Control Panel(0),
Add Table(Column Table(Statistics(N)), Row Table(Grouping Columns(:TestStage)))
)
)
)
);
wait(0);
(nw << XPath("//TextBox[contains(text(), 'Where(')]")) << Visibility("Collapse");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
Have you considered using Tabulate?
Names Default To Here(1);
dt = Open("$DOWNLOADS/example_DataTable.jmp");
nw = New Window("",
Data Filter Context Box(
H List Box(
dt << Data Filter(Local,
Add Filter(
columns(:TestWk),
Modeling Type(:TestWk, Nominal),
Where(
:TestWk == {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}
),
Display(:TestWk, Find(Set Text("")))
)
),
gb = dt << Graph Builder(
Size(744, 332),
Show Control Panel(0),
Variables(X(:TestWk), Y(:Median), Group Y(:TestStage)),
Elements(
Points(X, Y, Legend(8)),
Caption Box(X, Y, Legend(10), Summary Statistic("N"))
),
SendToReport(Dispatch({}, "TestWk", ScaleBox, {Label Row(Show Major Grid(1))}))
),
tab = dt << Tabulate(Show Control Panel(0), Add Table(Row Table(Grouping Columns(:TestStage))))
)
)
);
If this isn't enough you could add button to turn the tabulate into data table (and make tabulate hidden if necessary).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
@jthi Thanks, I got your suggestion to work for my actual case. I would like to control two more things if this is possible.
How to change the "N" (blue arrow) on the table to something like "die tested"?
How to remove the text below the chart and the tabulated table (circled in red below)?
Also, how to get the sum of "N"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
I'm not sure how to easily keep that hidden from tabulate as it seems to re-create it based on something (when you have too large Where statement it adds it back or something weird). You can do it with filter change handler but I would try to avoid that as much as possible (I would rather keep that Where text than start messing with those).
Names Default To Here(1);
dt = Open("$DOWNLOADS/example_DataTable.jmp");
nw = New Window("",
Data Filter Context Box(
H List Box(
dt << Data Filter(Local,
Add Filter(
columns(:TestWk),
Modeling Type(:TestWk, Nominal),
Where(
:TestWk == {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}
),
Display(:TestWk, Find(Set Text("")))
)
),
gb = dt << Graph Builder(
Size(744, 332),
Show Control Panel(0),
Variables(X(:TestWk), Y(:Median), Group Y(:TestStage)),
Elements(
Points(X, Y, Legend(8)),
Caption Box(X, Y, Legend(10), Summary Statistic("N"))
),
SendToReport(Dispatch({}, "TestWk", ScaleBox, {Label Row(Show Major Grid(1))}))
),
tab = dt << Tabulate(
Change Item Label(Statistics(N, "Die tested")),
Show Control Panel(0),
Add Table(Column Table(Statistics(N)), Row Table(Grouping Columns(:TestStage)))
)
)
)
);
wait(0);
(nw << XPath("//TextBox[contains(text(), 'Where(')]")) << Visibility("Collapse");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
@jthi Thanks, I do not mind the where statements in JMP, but when copying the chart onto other windows apps, I would have preferred not to have them.
Is it possible to display the sum of "N" (i.e. Total Die Tested) below the table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
You can add extra V List Box to wrap graph builder and tabulate
Names Default To Here(1);
dt = Open("$DOWNLOADS/example_DataTable.jmp");
nw = New Window("",
Data Filter Context Box(
H List Box(
dt << Data Filter(Local,
Add Filter(
columns(:TestWk),
Modeling Type(:TestWk, Nominal),
Where(
:TestWk == {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}
),
Display(:TestWk, Find(Set Text("")))
)
),
V List Box(
gb = dt << Graph Builder(
Size(744, 332),
Show Control Panel(0),
Variables(X(:TestWk), Y(:Median), Group Y(:TestStage)),
Elements(
Points(X, Y, Legend(8)),
Caption Box(X, Y, Legend(10), Summary Statistic("N"))
),
SendToReport(Dispatch({}, "TestWk", ScaleBox, {Label Row(Show Major Grid(1))}))
),
)
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
@jthiThanks, but do not get the V List box in my JMP 16 using your script.
Also, what I mean as as sum is a value of 14 (2+2+3+3+2+2) displayed on the chart, in this case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get Caption Box values in a datatable?
You could use separate tabulate for that
Names Default To Here(1);
dt = Open("$DOWNLOADS/example_DataTable.jmp");
nw = New Window("",
Data Filter Context Box(
H List Box(
dt << Data Filter(Local,
Add Filter(
columns(:TestWk),
Modeling Type(:TestWk, Nominal),
Where(
:TestWk == {19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}
),
Display(:TestWk, Find(Set Text("")))
)
),
V List Box(
gb = dt << Graph Builder(
Size(744, 332),
Show Control Panel(0),
Variables(X(:TestWk), Y(:Median), Group Y(:TestStage)),
Elements(
Points(X, Y, Legend(8)),
Caption Box(X, Y, Legend(10), Summary Statistic("N"))
),
SendToReport(Dispatch({}, "TestWk", ScaleBox, {Label Row(Show Major Grid(1))}))
),
tab2 = dt << Tabulate(Show Control Panel(0), Add Table(Column Table(Statistics(N))))
),
tab = dt << Tabulate(
Change Item Label(Statistics(N, "Die tested")),
Show Control Panel(0),
Add Table(Column Table(Statistics(N)), Row Table(Grouping Columns(:TestStage)))
)
)
)
);
wait(0);
(nw << XPath("//TextBox[contains(text(), 'Where(')]")) << Visibility("Collapse");