<?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 How can I combine text strings that are in a different order? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724595#M90745</link>
    <description>&lt;P&gt;Hard to explain in words, but the attached file should clarify my problem.&amp;nbsp; I have data for a number of airplane tickets with originating (column ORIGIN) and terminating (column DEST) airports.&amp;nbsp; I also combined these to show the route.&amp;nbsp; But I want the route from A to B to be the same as the route from B to A.&amp;nbsp; Right now, this will appear as two different strings, for example ANC to ADK is distinct from ADK to ANC.&amp;nbsp; I would like a column to identify these as the same route and not two distinct routes.&amp;nbsp; I haven't yet figured out a way to do this.&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2024 13:45:31 GMT</pubDate>
    <dc:creator>dlehman1</dc:creator>
    <dc:date>2024-02-17T13:45:31Z</dc:date>
    <item>
      <title>How can I combine text strings that are in a different order?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724595#M90745</link>
      <description>&lt;P&gt;Hard to explain in words, but the attached file should clarify my problem.&amp;nbsp; I have data for a number of airplane tickets with originating (column ORIGIN) and terminating (column DEST) airports.&amp;nbsp; I also combined these to show the route.&amp;nbsp; But I want the route from A to B to be the same as the route from B to A.&amp;nbsp; Right now, this will appear as two different strings, for example ANC to ADK is distinct from ADK to ANC.&amp;nbsp; I would like a column to identify these as the same route and not two distinct routes.&amp;nbsp; I haven't yet figured out a way to do this.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 13:45:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724595#M90745</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-02-17T13:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine text strings that are in a different order?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724597#M90746</link>
      <description>&lt;P&gt;You could create a list of your values in a single row, sort that and finally concatenate the values in sorted list together. &lt;/P&gt;
&lt;P&gt;Below is one option using associative array&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Concat Items(Associative Array(Eval List({:ORIGIN, :DEST})) &amp;lt;&amp;lt; Get Keys, "-")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but using something like this should also work nicely&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Concat Items(Sort List(Eval List({:ORIGIN, :DEST})), "-")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Feb 2024 14:30:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724597#M90746</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-02-17T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine text strings that are in a different order?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724598#M90747</link>
      <description>&lt;P&gt;I'm an experienced JMP user, but I have avoided scripting.&amp;nbsp; I can't figure out how to use your solution.&amp;nbsp; When I enter that script (with ; and the end), nothing happens.&amp;nbsp; What am I missing?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 14:41:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724598#M90747</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-02-17T14:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine text strings that are in a different order?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724605#M90748</link>
      <description>&lt;P&gt;Hi Dale, just create a new column and enter the code as formula:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1708182142242.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61199i7219E9C5F41F4E3B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1708182142242.png" alt="hogi_0-1708182142242.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;alternatively, open a script window and run this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Column( "Concatenate[ORIGIN,DEST]",	Character,
	Formula( Concat Items( Sort List( Eval List( {:ORIGIN, :DEST} ) ), "-" ) ))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Feb 2024 15:03:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724605#M90748</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-02-17T15:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine text strings that are in a different order?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724608#M90750</link>
      <description>&lt;P&gt;Thanks to both hogi and jthi.&amp;nbsp; You are both spoiling me, as there is little reason for me to learn JSL when you solve my problems for me.&amp;nbsp; But don't worry - I'm old enough that I'm not learning bad habits, and I urge my students to learn scripting even if I don't see the sense of it for me.&amp;nbsp; But it does illustrate something I've been thinking about after 45 years of teaching:&amp;nbsp; the real valuable skill is being able to ask questions, not answer them.&amp;nbsp; There are plenty of answers available, but you need to ask a good question to get good answers (especially true in this era of AI and LLMs).&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2024 15:14:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-combine-text-strings-that-are-in-a-different-order/m-p/724608#M90750</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-02-17T15:14:32Z</dc:date>
    </item>
  </channel>
</rss>

