<?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 to join two tables based on non-identical strings (Use Regex?) in JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804548#M98220</link>
    <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot for your feedback,&lt;/P&gt;&lt;P&gt;I tried this piece of script on a larger dataset and it seems to be accurate enough, it matches &amp;gt;96% of the time.&lt;/P&gt;&lt;P&gt;I added "Replace Unmatched(&lt;SPAN&gt;1&lt;/SPAN&gt;), Unmatched (value=&lt;SPAN&gt;"NoMatch"&lt;/SPAN&gt;)" to the arguments of Choose Closest () to make sure it flags when there is no match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help once again :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Voiz&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 19:26:15 GMT</pubDate>
    <dc:creator>Voizingu</dc:creator>
    <dc:date>2024-10-09T19:26:15Z</dc:date>
    <item>
      <title>Need to join two tables based on non-identical strings (Use Regex?) in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804360#M98193</link>
      <description>&lt;P&gt;Hello,&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have a JSL table imported from a tester station.&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The station reports the metrics and some attributes, including the Config Code of the devices under test.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to join another table (config matrix) with some categorical info (component vendor, …), based on the config code.&lt;/P&gt;&lt;P&gt;Unfortunately the config code reported by the station is not a 100% match with the config matrix (case sensitive, missing letter, extra “-“,…)&lt;/P&gt;&lt;P&gt;I would like to find a robust way to match them, and I think the Regex function is the best one, but I am a bit overwhelmed.&lt;/P&gt;&lt;P&gt;I checked a lot of posts on this forum talking about this function but I haven’t found yet a use-case close enough to mine to get me started.&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Voiz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below an example of 2 columns to be matched, I used a third column to remove the "-" with substitute(), and a 4th column to compare but the match is still weak on most cases.&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="image.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68919i8B7B66762AAA321B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "untitled 1",
	Add Rows( 8 ),
	New Column( "Tester config output",
		Character,
		"Nominal",
		Set Values(
			{"U4002LKR1B", "4005FGG1A", "U3001PL-2jR", "U5011G1A", "5001BLG1D",
			"U5003R2A", "U4005BLG1B", "U6034UBLG2A"}
		),
		Set Display Width( 114 )
	),
	New Column( "config matrix name",
		Character,
		"Nominal",
		Set Values(
			{"U4002-LK-R1B", "U4005-FG-G1A", "U3001-PL-2JR", "U5011-G1A",
			"U5001-BL-G1D", "U5003-R2A", "U4005-BL-G1B", "U6034-UBL-G2A"}
		)
	),
	New Column( "Clean Config Matrix Name",
		Character,
		"Nominal",
		Formula( Substitute( :config matrix name, "-", "" ) )
	),
	New Column( "Column 4",
		Character,
		"Nominal",
		Formula( If( :Clean Config Matrix Name == :Tester config output, "Match" ) )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 21:08:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804360#M98193</guid>
      <dc:creator>Voizingu</dc:creator>
      <dc:date>2024-10-08T21:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need to join two tables based on non-identical strings (Use Regex?) in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804416#M98198</link>
      <description>&lt;P&gt;Unless you can specify all the rules which should be followed I would suggest using something like&amp;nbsp;Choose Closest function (or Shortest Edit Script). This post can maybe give some ideas&amp;nbsp;&lt;LI-MESSAGE title="Script the &amp;amp;quot;Group Similar Values&amp;amp;quot; function in the Recode platform with JSL" uid="771878" url="https://community.jmp.com/t5/Discussions/Script-the-quot-Group-Similar-Values-quot-function-in-the-Recode/m-p/771878#U771878" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 04:32:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804416#M98198</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-09T04:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need to join two tables based on non-identical strings (Use Regex?) in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804461#M98209</link>
      <description>&lt;P&gt;I might be incorrect on what you are trying to do, but this is simplified version of what could be done&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt1 = New Table("Output",
	New Column("Tester config output",
		Character,
		"Nominal",
		Set Values(
			{"U4002LKR1B", "4005FGG1A", "U3001PL-2jR", "U5011G1A", "5001BLG1D", "U5003R2A",
			"U4005BLG1B", "U6034UBLG2A"}
		)
	)
);

dt2 = New Table("Config",
	New Column("config matrix name",
		Character,
		"Nominal",
		Set Values(
			{"U4002-LK-R1B", "U4005-FG-G1A", "U3001-PL-2JR", "U5011-G1A", "U5001-BL-G1D",
			"U5003-R2A", "U4005-BL-G1B", "U6034-UBL-G2A"}
		)
	),
	New Column("R", Numeric, Nominal, Set Values(1::8))
);

Summarize(dt2, groups = By(:config matrix name));

dt1 &amp;lt;&amp;lt; new column("N", Character, Nominal);
For Each Row(dt1,
	:N = Choose Closest(:Tester config output, groups, Ignore Case(1), Ignore Whitespace(1), Ignore Nonprintable(1), Max Edit Count(2), Max Edit Ratio(0.1));
);

dt1 &amp;lt;&amp;lt; Update(
	With(dt2),
	Match Columns(:N = :config matrix name),
	Replace Columns in Main Table(None)
);

Write();
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2024 13:58:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804461#M98209</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-09T13:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need to join two tables based on non-identical strings (Use Regex?) in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804548#M98220</link>
      <description>&lt;P&gt;Hi Jarmo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot for your feedback,&lt;/P&gt;&lt;P&gt;I tried this piece of script on a larger dataset and it seems to be accurate enough, it matches &amp;gt;96% of the time.&lt;/P&gt;&lt;P&gt;I added "Replace Unmatched(&lt;SPAN&gt;1&lt;/SPAN&gt;), Unmatched (value=&lt;SPAN&gt;"NoMatch"&lt;/SPAN&gt;)" to the arguments of Choose Closest () to make sure it flags when there is no match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help once again :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Voiz&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 19:26:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-to-join-two-tables-based-on-non-identical-strings-Use-Regex/m-p/804548#M98220</guid>
      <dc:creator>Voizingu</dc:creator>
      <dc:date>2024-10-09T19:26:15Z</dc:date>
    </item>
  </channel>
</rss>

