<?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: Need help to find out the difference of two variables listed here in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589975#M79464</link>
    <description>&lt;P&gt;Thanks for kind explanation and good way for the debugging!&lt;/P&gt;&lt;P&gt;It's first time I learned Regular Expression (Regex) in JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI, I captured debugger tool for the snapshot as you mentioned.&lt;/P&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>Mon, 16 Jan 2023 03:06:06 GMT</pubDate>
    <dc:creator>Owen_Kim</dc:creator>
    <dc:date>2023-01-16T03:06:06Z</dc:date>
    <item>
      <title>Need help to find out the difference of two variables listed here</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589659#M79436</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me ask a question regarding Text Edit Box() function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Goal&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Copy and Paste Excel values (Certain SerialNumber) into text edit box&amp;nbsp; and sort the Panel box (inserted SerialNumber)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Owen_Kim_0-1673677223345.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49070i649591A2E5C00DF1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Owen_Kim_0-1673677223345.png" alt="Owen_Kim_0-1673677223345.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created some script referring to examples in JMP community as below.&lt;/P&gt;&lt;P&gt;The script is needs to be updated though.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Delete Symbols();

Names Default To Here( 1 );

//Define Seperate function

SeparateString = Function( {TheString},
	TheList = Words(TheString," ");
	
	Return( TheList );
);



dt = Current Data Table();



Summarize( sn = by( :SN ) );
serial_total = sn;

//dt2 = New table("tmp", New Column("serialnumber",character, set values(sn)));

New Window("Debug",
	H List Box(

		V List Box(TEXT BOX("Copy and Paste SerialNumber list", &amp;lt;&amp;lt;set font style("Bold")),
		H List Box(
			Icon Box( "SearchIndex" ),
			Spacer Box( size( 5, 10 ) ),
			item_search_teb = Text Edit Box( "",
				&amp;lt;&amp;lt;set width( 200 ), 
// The filter_items function does the work
				&amp;lt;&amp;lt;set nlines( 10 )
			),
			reset_button = Button Box( "",
				&amp;lt;&amp;lt;set icon( "DebuggerDeleteBreakpoint" ),
				&amp;lt;&amp;lt;set script(
// Clear the filter and call the callback function
					item_search_teb &amp;lt;&amp;lt; set text( "" );
				),
				&amp;lt;&amp;lt;set tip( "Clear filter" )
			),

		)
		,
		
		Button box("Filtering",
			
			tmp =Eval(item_search_teb &amp;lt;&amp;lt;get text);
			str = "MD5 MD6 MD7 MD8 ";
			split_str = Words(str," ");
			split_tmp = Words(tmp," ");
			
			
			
			serial_list = SeparateString(tmp);
			total_flag =Associative Array( serial_total );
			list_flag = Associative Array( serial_list );
			total_flag &amp;lt;&amp;lt; intersect (list_flag);
			
			serial_total = total_flag &amp;lt;&amp;lt; get keys;
		)
		
		)
		
	
		
		
	, 
		
		Panel Box( "SerialNumber list : "  ,
			disp_box = List Box( sn, Max Selected( 1 ), width( 200 ), nlines( 10 ) ), 

		), 
		
	);
	)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, when I input below values in text edit box, it seems the extracted string has delimiter " ", but it cannot be splitted as I thought.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;MD5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;MD6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;MD7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;MD8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added simple script to check if it is splitted well, as you can see below figure, "str" can be splitted, however, "tmp" cannot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I put the values to excel and compare it with Exact function, both value is just same, but seems like JSL classified two variable as different one.&lt;/P&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;&lt;P&gt;tmp =Eval(item_search_teb &amp;lt;&amp;lt;get text);&lt;BR /&gt;str = "MD5 MD6 MD7 MD8 ";&lt;BR /&gt;split_str = Words(str," ");&lt;BR /&gt;split_tmp = Words(tmp," ");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Owen_Kim_1-1673677441237.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/49071i9C914335E6AA5753/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Owen_Kim_1-1673677441237.png" alt="Owen_Kim_1-1673677441237.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you find out what is the difference and let me know the solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:43:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589659#M79436</guid>
      <dc:creator>Owen_Kim</dc:creator>
      <dc:date>2023-06-08T16:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to find out the difference of two variables listed here</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589693#M79439</link>
      <description>&lt;P&gt;Try using "\!N" as separator for tmp instead of " ".&lt;/P&gt;
&lt;P&gt;Most likely the separator is some sort of row change and not " " when you copy-paste values from Excel. I'm not sure where your variable image is from (JSL Debugger?) but maybe it cannot show row changes properly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Also depending on your application, sometimes you might be better off replacing all white spaces (or just different kinds of row changes) with some character (I usually use ¤) using Regex and then using Words to split on that character. I usually do this, because the copy-pasted values might have all kinds of weird whitespace characters and just splitting on \!N won't be enough.&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);

str = "asd b 

\!na
\!rb";
Print(str);

new_separator = "¤";
l = Words(Regex(str, "\s", new_separator, GLOBALREPLACE), new_separator);
Show(l);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jan 2023 12:37:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589693#M79439</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-01-14T12:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to find out the difference of two variables listed here</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589975#M79464</link>
      <description>&lt;P&gt;Thanks for kind explanation and good way for the debugging!&lt;/P&gt;&lt;P&gt;It's first time I learned Regular Expression (Regex) in JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI, I captured debugger tool for the snapshot as you mentioned.&lt;/P&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>Mon, 16 Jan 2023 03:06:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-to-find-out-the-difference-of-two-variables-listed/m-p/589975#M79464</guid>
      <dc:creator>Owen_Kim</dc:creator>
      <dc:date>2023-01-16T03:06:06Z</dc:date>
    </item>
  </channel>
</rss>

