<?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: Value ordering by date in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/66117#M34371</link>
    <description>&lt;P&gt;You can work out a scripting solution for that, but I would think it would be far easier to just convert this column to have a valid date format so that JMP will do the correct value ordering automatically.&lt;/P&gt;&lt;P&gt;Here's one way to do that that creates a new column "H_Date2"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; New Column("H_Date2",formula(Num( If(IsMissing(Word(2, :H_Date)),"01",Word(2, :H_Date)) || Word( 1, :H_Date ) || "2018" )));
dt:H_Date2 &amp;lt;&amp;lt; Format("ddMonyyyy","ddMonyyyy");
dt:H_Date2 &amp;lt;&amp;lt; Modeling Type("nominal");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Basically what it is doing is taking the first and second words in the column H_Date to construct a value of the form "01Jan2018" from "Jan 01".&amp;nbsp; JMP automatically recognizes character strings like this as a date, so you can just convert the resulting character string to a numeric date-time value using num().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed you had a value "Jan" without a day value.&amp;nbsp; In this case, I just insert "01" as the day.&amp;nbsp; If that's not how you want to handle that, you can have it do whatever you want.&amp;nbsp; That's all handled in this bit:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(IsMissing(Word(2, :H_Date)),"01",Word(2, :H_Date))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, you need to put it in a readable date format, which is what Format() does.&amp;nbsp; You can substitute any date format you like for the first argument if you don't want "ddMonyyyy".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I assume you'd want the modeling type to be nominal instead of continuous.&amp;nbsp; That's what the last line does.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You can verify it does the correct value ordering by adding a value ordering property to the column H_Date2 and looking at the default ordering.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 17:13:56 GMT</pubDate>
    <dc:creator>cwillden</dc:creator>
    <dc:date>2018-08-02T17:13:56Z</dc:date>
    <item>
      <title>Value ordering by date</title>
      <link>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/65803#M34347</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question on value ordering. Refer to picture attached, how can re-arrange the month/day in ascending order. In this case, the day/month is unpredictable (eg. it can be on Feb03 and the next date is Feb10 follow by Feb 18 and the list is long for a span of 6-12months. I knew that I can manually select and Move Up/Down. How can I do it in a script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="valueorder2.jpg" style="width: 864px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11827i4BE1DAB6A6D9D744/image-size/large?v=v2&amp;amp;px=999" role="button" title="valueorder2.jpg" alt="valueorder2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 13:22:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/65803#M34347</guid>
      <dc:creator>adam</dc:creator>
      <dc:date>2018-08-02T13:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Value ordering by date</title>
      <link>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/66117#M34371</link>
      <description>&lt;P&gt;You can work out a scripting solution for that, but I would think it would be far easier to just convert this column to have a valid date format so that JMP will do the correct value ordering automatically.&lt;/P&gt;&lt;P&gt;Here's one way to do that that creates a new column "H_Date2"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; New Column("H_Date2",formula(Num( If(IsMissing(Word(2, :H_Date)),"01",Word(2, :H_Date)) || Word( 1, :H_Date ) || "2018" )));
dt:H_Date2 &amp;lt;&amp;lt; Format("ddMonyyyy","ddMonyyyy");
dt:H_Date2 &amp;lt;&amp;lt; Modeling Type("nominal");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Basically what it is doing is taking the first and second words in the column H_Date to construct a value of the form "01Jan2018" from "Jan 01".&amp;nbsp; JMP automatically recognizes character strings like this as a date, so you can just convert the resulting character string to a numeric date-time value using num().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed you had a value "Jan" without a day value.&amp;nbsp; In this case, I just insert "01" as the day.&amp;nbsp; If that's not how you want to handle that, you can have it do whatever you want.&amp;nbsp; That's all handled in this bit:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(IsMissing(Word(2, :H_Date)),"01",Word(2, :H_Date))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, you need to put it in a readable date format, which is what Format() does.&amp;nbsp; You can substitute any date format you like for the first argument if you don't want "ddMonyyyy".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I assume you'd want the modeling type to be nominal instead of continuous.&amp;nbsp; That's what the last line does.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You can verify it does the correct value ordering by adding a value ordering property to the column H_Date2 and looking at the default ordering.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 17:13:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/66117#M34371</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-08-02T17:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Value ordering by date</title>
      <link>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/66217#M34392</link>
      <description>&lt;P&gt;Thanks Cameron! That's a good solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Aug 2018 01:45:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Value-ordering-by-date/m-p/66217#M34392</guid>
      <dc:creator>adam</dc:creator>
      <dc:date>2018-08-03T01:45:35Z</dc:date>
    </item>
  </channel>
</rss>

