<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to return value from check box to desired format? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338083#M58585</link>
    <description>&lt;P&gt;The value returned from&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cb &amp;lt;&amp;lt; Get Selected()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a JMP List. The reason for this, is that more than one value can be selected in the Check Box().&amp;nbsp; Elements from a list can be referenced independently from the entire list, by specifying a subscript.&amp;nbsp; This was the question in your first question.&amp;nbsp; Therefore,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;returned = (cb &amp;lt;&amp;lt; Get Selected())[1];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;returns the first item from the list.&lt;/P&gt;
&lt;P&gt;From your latest entry, I don't believe you need to deal with the individual elements of the list, to accomplish the generation of the Tabulate.&amp;nbsp; Below is a simple example using your input window, that should show you how to handle the information coming out of the Check Box().&amp;nbsp; The code also uses one method of handling the situation when no statistic has been selected.&amp;nbsp; I changed the New Window to a "Modal" window.&amp;nbsp; A New Window by default, does not stop the processing in a JMP script.&amp;nbsp; However, a Modal window does stop the processing and waits for the user input before continuing with the processing.&amp;nbsp; To answer your question about Cp and Cpk, the Tabulate Platform does not have Cp or Cpk available.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

returned = {};

New Window( "Example",
	&amp;lt;&amp;lt;modal,
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		returned = (cb &amp;lt;&amp;lt; Get Selected());
		Print( returned ) //{"Mean", "Std Dev"} or etc
		;
	)
);

If( N Items( returned ) == 0,
	Dialog( "You must select at least one statistic" );
	Throw();
);

Tabulate(
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Statistics( Eval( returned ) ), Analysis Columns( :height ) ),
		Row Table( Grouping Columns( :age ) )
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I strongly suggest that you take the time to read the Scripting Guide.&amp;nbsp; I will give you the base information about the JSL structures, such as Lists, and platform utilization, such as Tabulate, which will make your development of JMP Scripts much easier.&lt;/P&gt;
&lt;P&gt;The Scripting Guide is found in the JMP Documentation Library, available under the Help pull down menu.&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 29 Nov 2020 11:04:04 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2020-11-29T11:04:04Z</dc:date>
    <item>
      <title>How to return value from check box to desired format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338034#M58576</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using example from scripting index and modified as per below script.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		Print( cb &amp;lt;&amp;lt; Get Selected () ) //{"Mean", "Std Dev"} or etc
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there any possibility to return the selected value from checkbox into "One" or One instead of {"One"}? I would like to use selected value for tabulate statistic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Statistics( Max, Median, Min, Mean, Std Dev )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;By any chance, can I add Cp and Cpk on the Tabulate table?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:22:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338034#M58576</guid>
      <dc:creator>WanCine</dc:creator>
      <dc:date>2023-06-10T23:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to return value from check box to desired format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338055#M58578</link>
      <description>&lt;P&gt;The check box() is returning a List.&amp;nbsp; All you have to do is to specify which element of the list you want, and it will return it as a scalar value.&amp;nbsp; See below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
New Window( "Example",
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		returned = (cb &amp;lt;&amp;lt; Get Selected ())[1];
		Print( returned ) //{"Mean", "Std Dev"} or etc
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Nov 2020 02:41:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338055#M58578</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-29T02:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to return value from check box to desired format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338082#M58584</link>
      <description>&lt;P&gt;Hi Txnelson,&lt;/P&gt;&lt;P&gt;I try the given code, but when set to [1], it only return one value only instead of "Max","Median" and when untick all value from box it return an error. The list should be responded to whatever value that been tick or untick. Is that need to do for loop or any other better ways?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WanCine_0-1606645005446.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28659i18973FB8C259FE0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WanCine_0-1606645005446.png" alt="WanCine_0-1606645005446.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WanCine_1-1606645167858.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/28660i2A52B0E81B3ED62B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WanCine_1-1606645167858.png" alt="WanCine_1-1606645167858.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 10:23:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338082#M58584</guid>
      <dc:creator>WanCine</dc:creator>
      <dc:date>2020-11-29T10:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to return value from check box to desired format?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338083#M58585</link>
      <description>&lt;P&gt;The value returned from&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cb &amp;lt;&amp;lt; Get Selected()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a JMP List. The reason for this, is that more than one value can be selected in the Check Box().&amp;nbsp; Elements from a list can be referenced independently from the entire list, by specifying a subscript.&amp;nbsp; This was the question in your first question.&amp;nbsp; Therefore,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;returned = (cb &amp;lt;&amp;lt; Get Selected())[1];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;returns the first item from the list.&lt;/P&gt;
&lt;P&gt;From your latest entry, I don't believe you need to deal with the individual elements of the list, to accomplish the generation of the Tabulate.&amp;nbsp; Below is a simple example using your input window, that should show you how to handle the information coming out of the Check Box().&amp;nbsp; The code also uses one method of handling the situation when no statistic has been selected.&amp;nbsp; I changed the New Window to a "Modal" window.&amp;nbsp; A New Window by default, does not stop the processing in a JMP script.&amp;nbsp; However, a Modal window does stop the processing and waits for the user input before continuing with the processing.&amp;nbsp; To answer your question about Cp and Cpk, the Tabulate Platform does not have Cp or Cpk available.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );

returned = {};

New Window( "Example",
	&amp;lt;&amp;lt;modal,
	cb = Check Box(
		{"Max", "Median", "Min", "Mean", "Std Dev"},
		returned = (cb &amp;lt;&amp;lt; Get Selected());
		Print( returned ) //{"Mean", "Std Dev"} or etc
		;
	)
);

If( N Items( returned ) == 0,
	Dialog( "You must select at least one statistic" );
	Throw();
);

Tabulate(
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Statistics( Eval( returned ) ), Analysis Columns( :height ) ),
		Row Table( Grouping Columns( :age ) )
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I strongly suggest that you take the time to read the Scripting Guide.&amp;nbsp; I will give you the base information about the JSL structures, such as Lists, and platform utilization, such as Tabulate, which will make your development of JMP Scripts much easier.&lt;/P&gt;
&lt;P&gt;The Scripting Guide is found in the JMP Documentation Library, available under the Help pull down menu.&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 11:04:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-return-value-from-check-box-to-desired-format/m-p/338083#M58585</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-11-29T11:04:04Z</dc:date>
    </item>
  </channel>
</rss>

