<?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 ask User select columns then proceed distribution in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237622#M46921</link>
    <description>&lt;P&gt;I can't help you with Tableau.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A JMP script that might work is the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = Current Data Table();

dialog = New Window( "Select Columns", &amp;lt;&amp;lt; Modal,
	y col list = Col List Box(
		All
	),
	H List Box(
		Button Box( "OK",
			y col = y col list &amp;lt;&amp;lt; Get Selected;
		),
		Button Box( "Cancel" )
	)
);

If( dialog["Button"] == -1,
	Throw( "User cancelled" );
);

Show( y col );

If( N Items( y col ) &amp;gt; 0,
	y expr = Expr( Y() );
	For( i = 1, i &amp;lt;= N Items( y col ), i++,
		Insert Into( y expr, Column( y col[i] ) );
	);
	Eval(
		Substitute(
			Expr( dt &amp;lt;&amp;lt; Distribution( yyy) ),
			Expr( yyy ), Name Expr( y expr )
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 15:31:37 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-12-06T15:31:37Z</dc:date>
    <item>
      <title>How to ask User select columns then proceed distribution</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237565#M46906</link>
      <description>&lt;P&gt;Hi all, I'm currenly trying to learn the tableau script and want to releiazed one feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ask User choose 1 or many cloumn --&amp;gt; proceed distribuiton&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know how to relaized this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 09:14:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237565#M46906</guid>
      <dc:creator>Tooony</dc:creator>
      <dc:date>2019-12-06T09:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to ask User select columns then proceed distribution</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237622#M46921</link>
      <description>&lt;P&gt;I can't help you with Tableau.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A JMP script that might work is the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = Current Data Table();

dialog = New Window( "Select Columns", &amp;lt;&amp;lt; Modal,
	y col list = Col List Box(
		All
	),
	H List Box(
		Button Box( "OK",
			y col = y col list &amp;lt;&amp;lt; Get Selected;
		),
		Button Box( "Cancel" )
	)
);

If( dialog["Button"] == -1,
	Throw( "User cancelled" );
);

Show( y col );

If( N Items( y col ) &amp;gt; 0,
	y expr = Expr( Y() );
	For( i = 1, i &amp;lt;= N Items( y col ), i++,
		Insert Into( y expr, Column( y col[i] ) );
	);
	Eval(
		Substitute(
			Expr( dt &amp;lt;&amp;lt; Distribution( yyy) ),
			Expr( yyy ), Name Expr( y expr )
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 15:31:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237622#M46921</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-12-06T15:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to ask User select columns then proceed distribution</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237740#M46954</link>
      <description>&lt;P&gt;Hi Mark, great thanks for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also faced one question want to ask. Nomally I will need proceed a table which use below script and decoding the serial number first to get date code/config and so on. &amp;nbsp;Due to some reason, the "SerialNumber" name will change to "battery Serial Number" or something else. if also has the way to let user select which column to "Munger" first, then ask user select columns to do the distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = currentdatatable();
dt &amp;lt;&amp;lt;
Select duplicate rows( Match( :SerialNumber ) );
xx=dt&amp;lt;&amp;lt;get selected rows;
if(n rows(xx)&amp;gt;0,
dt&amp;lt;&amp;lt;delete rows;
);

WAit(2);
NewColumn("Date Code", Numeric, Continuous, Formula(Munger( :Name( "Serial Number" ), 4, 3 )));
WAit(2);
NewColumn("Vendor", Numeric, Continuous, Formula(Munger( :Name( "Serial Number" ), 1, 3 )));
WAit(2);
NewColumn(“Config”, Numeric, Continuous, Formula(Munger( :Name( "Serial Number" ), 12, 5 )));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Dec 2019 07:44:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237740#M46954</guid>
      <dc:creator>Tooony</dc:creator>
      <dc:date>2019-12-07T07:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to ask User select columns then proceed distribution</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237746#M46958</link>
      <description>&lt;P&gt;This expanded script should show you how to proceed. It allows the user to make two selections in the same dialog box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

dialog = New Window( "Select Columns", &amp;lt;&amp;lt; Modal,
	Panel Box( "Column Selection",
		Lineup Box( N Col( 2 ),
			Text Box( "Select column for munging" ),
			m col list = Col List Box( All ),
			Text Box( "Select columns for distribution" ),
			y col list = Col List Box( All )
		)
	),
	H List Box(
		Button Box( "OK",
			m col = m col list &amp;lt;&amp;lt; Get Selected;
			y col = y col list &amp;lt;&amp;lt; Get Selected;
		),
		Button Box( "Cancel" )
	)
);

If( dialog["Button"] == -1,
	Throw( "User cancelled" )
);

Show( m col, y col );

dt &amp;lt;&amp;lt; Select Duplicate Rows( Match( :SerialNumber ) );
xx = dt &amp;lt;&amp;lt; Get Selected Rows;
If( N Rows( xx ) &amp;gt; 0,
	dt &amp;lt;&amp;lt; Delete Dows
);

dt	&amp;lt;&amp;lt; New Column( "Date Code", Numeric, Continuous, Formula( Munger( :Name( "Serial Number" ), 4, 3 ) ) )
	&amp;lt;&amp;lt; New Column( "Vendor",    Numeric, Continuous, Formula( Munger( :Name( "Serial Number" ), 1, 3 ) ) )
	&amp;lt;&amp;lt; New Column( “Config”,    Numeric, Continuous, Formula( Munger( :Name( "Serial Number" ), 12, 5 ) ) );
	
If( N Items( y col ) &amp;gt; 0,
	y expr = Expr( Y() );
	For( i = 1, i &amp;lt;= N Items( y col ), i++,
		Insert Into( y expr, Column( y col[i] ) )
	);
	Eval( Substitute( Expr( dt &amp;lt;&amp;lt; Distribution( yyy ) ), Expr( yyy ), Name Expr( y expr ) ) );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see no reason in the example that you provided for the column name to change to "batter serial number."&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 12:20:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-ask-User-select-columns-then-proceed-distribution/m-p/237746#M46958</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-12-07T12:20:41Z</dc:date>
    </item>
  </channel>
</rss>

