<?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 script Column Matching Dialog in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473285#M71789</link>
    <description>&lt;P&gt;Depending on how your application will work, it might be better not to append values to a list until user press run / ok button, as users might want to remove values from the list box (not currently possible).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added Run button and runExpr to this example (if you don't have JMP16, you can modify Transform Each into a For loop which will append values to a list), remove button and clearing of col list box selections when Match is pressed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
matchedList = {};

dt = New Table("Untitled 5",
	Add Rows(4),
	Set Header Height(46),
	New Column("X", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
	New Column("A_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([1, 3, 2, 3])),
	New Column("B_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 6, 5])),
	New Column("A_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([1, 4, 3, 4])),
	New Column("B_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 3, 4]))
);

notImplemented = Expr(
	a = (clb1 &amp;lt;&amp;lt; get selected)[1];
	b = (clb2 &amp;lt;&amp;lt; get selected)[1];
	clb1 &amp;lt;&amp;lt; Clear selection;
	clb2 &amp;lt;&amp;lt; Clear selection;
	lb &amp;lt;&amp;lt; Append(a || "=" || b);
);

notImplemented2 = Expr(
	lb &amp;lt;&amp;lt; Remove Selected;
);

runExpr = Expr(
	lb &amp;lt;&amp;lt; get items;
	lb_values = Transform Each({val}, lb &amp;lt;&amp;lt; get items, Words(val, "="));
	show(lb_values);
);

gui = Expr(
	H List Box(
		V List Box(
			Panel Box("Theory", 
				clb1 = Col List Box(All, Nlines(5))
			), 
			Panel Box("Experiment", 
				clb2 = Col List Box(All, Nlines(5))
			)
		),
		Panel Box("Theory vs Experiment Matching", 
			H List Box(
				Lineup box(N Col(1),
					Button Box("Match", notImplemented),
					Button Box("Remove", notImplemented2),
				),
				lb = List Box({}, Nlines(12))
			)
		),
		Panel Box("Actions",
			Button Box("Run",
				runExpr;
			)
		)
	)
);
fileLoad = New Window("Example", Show Menu(0), Show Toolbars(0), gui);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 26 Mar 2022 06:22:01 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-03-26T06:22:01Z</dc:date>
    <item>
      <title>How to script Column Matching Dialog</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473208#M71782</link>
      <description>&lt;P&gt;I have a dialog where I need a user to match pairs of columns. Pretty much like we do in Join Tables.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-03-25 11_51_23-Clipboard.png" style="width: 278px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41164i4E586A4A1AD39CBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-03-25 11_51_23-Clipboard.png" alt="2022-03-25 11_51_23-Clipboard.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specific example - I have sets of experimentally measured parameters and sets of their theoretical predictions. This data comes from different sources and colum naming can be arbitrary, so I need users to match theory vs experiment for each parameter.&lt;/P&gt;&lt;P&gt;Is there an example on how to script this part? And how to keep these pairs and how to use them later?&lt;/P&gt;&lt;P&gt;So far I have this, and I'm interested in how to script the box in green frame to reflect matched pairs (like in example above) and how to keep those pairs (list of 2 item lists?) and how to remove\recall them etc.:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-03-25 11_42_16-Clipboard.png" style="width: 469px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41165i7B5431B96E36611F/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-03-25 11_42_16-Clipboard.png" alt="2022-03-25 11_42_16-Clipboard.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And here is the script:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled 5",
	Add Rows( 4 ),
	Set Header Height( 46 ),
	New Column( "X", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 2, 3, 4] ) ),
	New Column( "A_Theory", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 3, 2, 3] ) ),
	New Column( "B_Measured", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [4, 5, 6, 5] ) ),
	New Column( "A_Measured", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 4, 3, 4] ) ),
	New Column( "B_Theory", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [4, 5, 3, 4] ) )
);
notImplemented = Expr(
	win = New Window( "Feature Not Implemented Yet", &amp;lt;&amp;lt;Modal, Button Box( "OK" ) )
);

gui = Expr(
	H List Box(V List Box(Panel Box("Theory",Col List Box(All, Nlines(5))),Panel Box("Experiment", Col List Box(All, Nlines(5)))), Panel box("Theory vs Experiment Matching",H List Box(Button Box("Match", notImplemented), List Box({}, Nlines(12)))) )
	
);


fileLoad = New Window( "Example",
	Show Menu( 0 ),
	Show Toolbars( 0 ),
	gui
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:14:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473208#M71782</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T18:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to script Column Matching Dialog</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473230#M71784</link>
      <description>&lt;P&gt;If I would have to guess, join platform uses Listbox in which it appends new values when you add column pairs.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 5",
	Add Rows(4),
	Set Header Height(46),
	New Column("X", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
	New Column("A_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([1, 3, 2, 3])),
	New Column("B_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 6, 5])),
	New Column("A_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([1, 4, 3, 4])),
	New Column("B_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 3, 4]))
);
notImplemented = Expr(
	a = clb1 &amp;lt;&amp;lt; get selected;
	b = clb2 &amp;lt;&amp;lt; get selected;
	lb &amp;lt;&amp;lt; Append(a[1] || "=" || b[1]);
);

gui = Expr(
	H List Box(
		V List Box(
			Panel Box("Theory", 
				clb1 = Col List Box(All, Nlines(5))
			), 
			Panel Box("Experiment", 
				clb2 = Col List Box(All, Nlines(5))
			)
		),
		Panel Box("Theory vs Experiment Matching", 
			H List Box(
				Button Box("Match", notImplemented), 
				lb = List Box({}, Nlines(12))
			)
		)
	)
);

fileLoad = New Window("Example", Show Menu(0), Show Toolbars(0), gui);

//{col1, col2} = Words((lb &amp;lt;&amp;lt; get items)[1], "=");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1648235071389.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/41166i0D7E1429D5608F8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1648235071389.png" alt="jthi_0-1648235071389.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just quickly threw together the script so use better naming than I did for variables, prevent selection of multiple values in col list boxes and remove hard-coded limits of column indexing. When you need the values you can get then with &amp;lt;&amp;lt; get items to the list box reference, which will give you a list of items. Then use Words() to further split that into different parts.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 19:04:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473230#M71784</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-25T19:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to script Column Matching Dialog</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473279#M71786</link>
      <description>&lt;P&gt;Let me try that.&lt;/P&gt;&lt;P&gt;And then to do something with these columns later (for instance, plot Fit Y by X for each pair) - is it OK to keep them as a list of lists?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;columnPairs = {{A_Theory, A_Experiment}, {B_Theory, B_Experiment}};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and then iterate through them or there's a better option?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 22:04:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473279#M71786</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-03-25T22:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to script Column Matching Dialog</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473280#M71787</link>
      <description>&lt;P&gt;One more question. I modified the script this way:&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);
matchedList = {};

dt = New Table("Untitled 5",
	Add Rows(4),
	Set Header Height(46),
	New Column("X", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
	New Column("A_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([1, 3, 2, 3])),
	New Column("B_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 6, 5])),
	New Column("A_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([1, 4, 3, 4])),
	New Column("B_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 3, 4]))
);
notImplemented = Expr(
	a = (clb1 &amp;lt;&amp;lt; get selected)[1];
	b = (clb2 &amp;lt;&amp;lt; get selected)[1];
	lb &amp;lt;&amp;lt; Append(a || "=" || b);
        Insert Into(matchedList, {a, b});
        Show(matchedList);
);

gui = Expr(
	H List Box(
		V List Box(
			Panel Box("Theory", 
				clb1 = Col List Box(All, Nlines(5))
			), 
			Panel Box("Experiment", 
				clb2 = Col List Box(All, Nlines(5))
			)
		),
		Panel Box("Theory vs Experiment Matching", 
			H List Box(
				Button Box("Match", notImplemented), 
				lb = List Box({}, Nlines(12))
			)
		)
	)
);

fileLoad = New Window("Example", Show Menu(0), Show Toolbars(0), gui);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I'm getting this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;matchedList = {a, b, a, b};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;While I was expecting this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;matchedList = {{"A_Theory", "A_Measured"}, {"B_Theory", "B_Measured"}}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or something along those line so I could iterate through pairs.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 22:41:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473280#M71787</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-03-25T22:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to script Column Matching Dialog</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473281#M71788</link>
      <description>&lt;P&gt;Ok, it works this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;notImplemented = Expr(
	a = (clb1 &amp;lt;&amp;lt; get selected)[1];
	b = (clb2 &amp;lt;&amp;lt; get selected)[1];
	lb &amp;lt;&amp;lt; Append(a || "=" || b);
    matchedList[N Items( matchedList ) + 1] = Eval List ({a, b});
    //Insert Into(matchedList, Eval List(columnPair));
    Show(matchedList);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 22:51:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473281#M71788</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-03-25T22:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to script Column Matching Dialog</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473285#M71789</link>
      <description>&lt;P&gt;Depending on how your application will work, it might be better not to append values to a list until user press run / ok button, as users might want to remove values from the list box (not currently possible).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added Run button and runExpr to this example (if you don't have JMP16, you can modify Transform Each into a For loop which will append values to a list), remove button and clearing of col list box selections when Match is pressed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
matchedList = {};

dt = New Table("Untitled 5",
	Add Rows(4),
	Set Header Height(46),
	New Column("X", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
	New Column("A_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([1, 3, 2, 3])),
	New Column("B_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 6, 5])),
	New Column("A_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([1, 4, 3, 4])),
	New Column("B_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 3, 4]))
);

notImplemented = Expr(
	a = (clb1 &amp;lt;&amp;lt; get selected)[1];
	b = (clb2 &amp;lt;&amp;lt; get selected)[1];
	clb1 &amp;lt;&amp;lt; Clear selection;
	clb2 &amp;lt;&amp;lt; Clear selection;
	lb &amp;lt;&amp;lt; Append(a || "=" || b);
);

notImplemented2 = Expr(
	lb &amp;lt;&amp;lt; Remove Selected;
);

runExpr = Expr(
	lb &amp;lt;&amp;lt; get items;
	lb_values = Transform Each({val}, lb &amp;lt;&amp;lt; get items, Words(val, "="));
	show(lb_values);
);

gui = Expr(
	H List Box(
		V List Box(
			Panel Box("Theory", 
				clb1 = Col List Box(All, Nlines(5))
			), 
			Panel Box("Experiment", 
				clb2 = Col List Box(All, Nlines(5))
			)
		),
		Panel Box("Theory vs Experiment Matching", 
			H List Box(
				Lineup box(N Col(1),
					Button Box("Match", notImplemented),
					Button Box("Remove", notImplemented2),
				),
				lb = List Box({}, Nlines(12))
			)
		),
		Panel Box("Actions",
			Button Box("Run",
				runExpr;
			)
		)
	)
);
fileLoad = New Window("Example", Show Menu(0), Show Toolbars(0), gui);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Mar 2022 06:22:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-script-Column-Matching-Dialog/m-p/473285#M71789</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-26T06:22:01Z</dc:date>
    </item>
  </channel>
</rss>

