<?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 help with jsl to convert table column from datetime yyyy/mm/dd hh:mm:ss to work week? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18051#M16456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for help to convert a table column from date time to work week, can you help me with a script to accomplish this conversion?&lt;/P&gt;&lt;P&gt;My data format is: 2016/03/21 8:59:27.921 PM and I'd like to convert this to calendar work week. I am using JMP 12.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Apr 2016 00:01:25 GMT</pubDate>
    <dc:creator>rrtx_mike</dc:creator>
    <dc:date>2016-04-15T00:01:25Z</dc:date>
    <item>
      <title>help with jsl to convert table column from datetime yyyy/mm/dd hh:mm:ss to work week?</title>
      <link>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18051#M16456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for help to convert a table column from date time to work week, can you help me with a script to accomplish this conversion?&lt;/P&gt;&lt;P&gt;My data format is: 2016/03/21 8:59:27.921 PM and I'd like to convert this to calendar work week. I am using JMP 12.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 00:01:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18051#M16456</guid>
      <dc:creator>rrtx_mike</dc:creator>
      <dc:date>2016-04-15T00:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: help with jsl to convert table column from datetime yyyy/mm/dd hh:mm:ss to work week?</title>
      <link>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18052#M16457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the JMP function:&amp;nbsp; Week of Year();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will either have to create a new column with the above function as the formula for the column, or to replace the values within the same column the following script will do it:&amp;nbsp;&amp;nbsp; Assume that the target column is named......MyDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Names Default to Here(1);&lt;/P&gt;&lt;P&gt;dt=current data table();&lt;/P&gt;&lt;P&gt;For Each Row(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyDate=Week of Year(MyDate);&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;dt:MyDate &amp;lt;&amp;lt; format("Best",5);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 12:28:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18052#M16457</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2016-04-15T12:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: help with jsl to convert table column from datetime yyyy/mm/dd hh:mm:ss to work week?</title>
      <link>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18053#M16458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jim you nailed it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;dt5 &amp;lt;&amp;lt; New Column( "Work Week", Numeric, "Continuous", Formula( Week of Year(:StartTime,3) ) );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I used your suggestion to create a new column with the Week of Year formula. I added the argument for rule 3 which is, according to the JSL Syntax Reference, ISO Work Week:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the Syntax Reference:&lt;/P&gt;&lt;P class="S1SynObj" style="margin: 16px 0 0; padding: 5px 0 0; font-family: 'Courier New', Courier, mono; border-top-width: 1pt; border-top-style: solid; border-top-color: #336699; font-size: 17.6px; color: #666666;"&gt;&lt;A name="3925903" style="background-position: initial;"&gt;Week Of Year(date, &amp;lt;rule_&lt;/A&gt;&lt;SPAN class="argument"&gt;n&lt;/SPAN&gt;&amp;gt;)&lt;/P&gt;&lt;P class="S2Syn" style="margin: 4px 0 0 16px; font-weight: bold; font-size: 0.9em; color: #666666; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;A name="3925904" style="background-position: initial;"&gt;Description&lt;/A&gt;&lt;/P&gt;&lt;P class="S3Syn" style="margin: 4px 0 0 32px; font-size: 0.9em; color: #666666; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;A name="3925080" style="text-decoration: inherit; background-position: inherit;"&gt;Returns the week of the year that contains a date-time value. Three rules determine when the first week of the year begins.&lt;/A&gt;&lt;/P&gt;&lt;P class="N2bullet_outer" style="margin: 8px 0 8px 30px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 16px;"&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" summary=""&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="nopadding"&gt;&lt;DIV class="N2bullet_inner_first"&gt;‒&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="100%"&gt;&lt;P class="N2bullet_inner" style="font-size: 0.9em;"&gt;&lt;A name="3925082" style="background-position: initial;"&gt;With rule 1 (the default), weeks start on Sunday, with the first Sunday of the year being week 2. Week 1 is a partial week or empty.&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="N2bullet_outer" style="margin: 8px 0 8px 30px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 16px;"&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" summary=""&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="nopadding"&gt;&lt;DIV class="N2bullet_inner_first"&gt;‒&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="100%"&gt;&lt;P class="N2bullet_inner" style="font-size: 0.9em;"&gt;&lt;A name="3925083" style="background-position: initial;"&gt;With rule 2, the first Sunday begins with week 1, with previous days being week 0.&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P class="N2bullet_outer" style="margin: 8px 0 8px 30px; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: 16px;"&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" summary=""&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="nopadding"&gt;&lt;DIV class="N2bullet_inner_first"&gt;‒&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD width="100%"&gt;&lt;P class="N2bullet_inner" style="font-size: 0.9em;"&gt;&lt;A name="4667210" style="background-position: initial;"&gt;With rule 3, the ISO-8601 week number is returned. Weeks start on Monday. Week 1 is the first week of the year with four days in that year. It is possible for the first or last three days of the year to belong to the neighboring year’s week number.&lt;/A&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2016 13:48:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/help-with-jsl-to-convert-table-column-from-datetime-yyyy-mm-dd/m-p/18053#M16458</guid>
      <dc:creator>rrtx_mike</dc:creator>
      <dc:date>2016-04-15T13:48:36Z</dc:date>
    </item>
  </channel>
</rss>

