<?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: week start date in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365733#M61520</link>
    <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;points out, your WR_Date column must be a datetime column containing a time of day. You need to subtract that off of it to get it to a date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do that in your formula:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-03-06_09-40-20.849.png" style="width: 638px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31043i02BF2DFF3EE7CF3E/image-dimensions/638x373?v=v2" width="638" height="373" role="button" title="2021-03-06_09-40-20.849.png" alt="2021-03-06_09-40-20.849.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attached data table has an example.&lt;/P&gt;</description>
    <pubDate>Sat, 06 Mar 2021 14:41:55 GMT</pubDate>
    <dc:creator>Jeff_Perkinson</dc:creator>
    <dc:date>2021-03-06T14:41:55Z</dc:date>
    <item>
      <title>week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365267#M61464</link>
      <description>&lt;P&gt;Hi, I have a column transaction date and need to transform it to the date of Monday in that week. I figured out the below formula and could reach to the right date I need. However it automatically became a character format and no matter how many times i switch it to nominal format it kept changing back to character. Does anyone know why? Thank you!&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-center" image-alt="Screen Shot 2021-03-04 at 3.55.29 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30983iEBA00BD9B623DD14/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-04 at 3.55.29 PM.png" alt="Screen Shot 2021-03-04 at 3.55.29 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:26:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365267#M61464</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2023-06-10T23:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365274#M61465</link>
      <description>&lt;P&gt;The &lt;A href="https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/date-time-functions.shtml#ww123345" target="_self"&gt;Short Date() function&lt;/A&gt; returns a character string which formats a date or datetime value into m/d/y format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want a JMP date value just remove the Short Date() and then set the format on the column to m/d/y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint: Use the &lt;A href="https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/keypad-reference.shtml" target="_self"&gt;peel button&lt;/A&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DeleteExpIcon_NoLoc.gif" style="width: 24px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30984i1B178AF360EA266F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DeleteExpIcon_NoLoc.gif" alt="DeleteExpIcon_NoLoc.gif" /&gt;&lt;/span&gt;&amp;nbsp;to remove the outer function from a selection in the Formula Editor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More here:&amp;nbsp;&lt;LI-MESSAGE title="Using dates, times, datetimes and durations in JMP" uid="68689" url="https://community.jmp.com/t5/JMPer-Cable/Using-dates-times-datetimes-and-durations-in-JMP/m-p/68689#U68689" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 22:20:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365274#M61465</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2021-03-04T22:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365279#M61466</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12917"&gt;@joann&lt;/a&gt;&amp;nbsp;, it is because the function Short Date is specified to return a character string,&lt;/P&gt;&lt;P&gt;see documentation library as attached.&lt;/P&gt;&lt;P&gt;So you should leave away that function to keep it a date, and use the column format instead to control its look.&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="Georg_0-1614896740029.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30985iC4B860351C9415B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Georg_0-1614896740029.png" alt="Georg_0-1614896740029.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Mar 2021 22:28:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365279#M61466</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2021-03-04T22:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365309#M61472</link>
      <description>&lt;P&gt;Thank you Jeff! The peel button is a new thing to me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one following question- after removing the short date function I put the new week date into tabulate, but it somehow show the same date multiple times while usually it will show unique dates, as below screenshot. Not sure why the reason. One possible thing i can think of is that the original date column that i used to create this new week start date, has format like "2018/01/01 12:13:05 AM". Do you know a way to fix the tabulate? Thank you!&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-center" image-alt="Screen Shot 2021-03-04 at 7.18.47 PM.png" style="width: 276px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30987i3AFAF10014FC200A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-03-04 at 7.18.47 PM.png" alt="Screen Shot 2021-03-04 at 7.18.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 00:25:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365309#M61472</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2021-03-05T00:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365310#M61473</link>
      <description>Thank you Georg! I have one following question about this column, could you check the above? Thank you.</description>
      <pubDate>Fri, 05 Mar 2021 00:26:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365310#M61473</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2021-03-05T00:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365362#M61477</link>
      <description>&lt;P&gt;You could create a formula where you remove hours, minutes and seconds from the date you have:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dateToday = Today();
Show(As Date(dateToday));
dateToday_noSeconds = dateToday - TimeOfDay(dateToday);
Show(As Date(dateToday_noSeconds));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Or directly with JMP (right click column name -&amp;gt; New Formula Column -&amp;gt; Date Time -&amp;gt; Date):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1614925871971.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/30994iF287741281D542BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1614925871971.png" alt="jthi_0-1614925871971.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 06:32:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365362#M61477</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-05T06:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365605#M61507</link>
      <description>Thank you so much! It worked using the second method. Bear with me with my very basic question-for the first method, where to plug in the script and which part should i change to my date column name "week start"?</description>
      <pubDate>Fri, 05 Mar 2021 21:06:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365605#M61507</guid>
      <dc:creator>joann</dc:creator>
      <dc:date>2021-03-05T21:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365694#M61512</link>
      <description>&lt;P&gt;You would have to create new script and add it there. My example script was just an quick example on the calculation in script editor. You would also have to change it to use column scripting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe this "full" example can show a bit better how it can be scripted (this as also additional formulas for Monday calculation). You can open new script from File / New / Script and copy paste this there. You would replace :DateTime in the "OnlyDate" column creation with your column name.&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&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);

dt = New Table("firstofweek",
	Add Rows(100),
	Compress File When Saved(1),
	New Column("DateTime",
		Numeric,
		"Continuous",
		Format("Monddyyyy h:m:s", 22, 0),
		Input Format("Monddyyyy h:m:s", 0),
		Formula(Today() - In Days(90-Row())),
		Set Display Width(111)
	)
);
Column(dt, "DateTime") &amp;lt;&amp;lt; Delete Formula;

dt &amp;lt;&amp;lt; New Column("OnlyDate", Numeric, "Continuous", Format("Monddyyyy h:m:s", 22, 0),
	&amp;lt;&amp;lt; Formula(:DateTime - Time Of Day(:DateTime))
);

dt &amp;lt;&amp;lt; New Column("FirstOfWeek1", Numeric, "Continuous", Format("Monddyyyy h:m:s", 22, 0),
	&amp;lt;&amp;lt; Formula(:DateTime - In Days(Day Of Week(:DateTime) - 2) - Time Of Day(:DateTime))
);

dt &amp;lt;&amp;lt; New Column("FirstOfWeek2", Numeric, "Continuous", Format("Monddyyyy h:m:s", 22, 0),
	&amp;lt;&amp;lt; Formula(Date Increment(:DateTime, "Week", 0, "start") + In Days(1))
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also JMP Scripting Guide and Scripting Index are excellent sources for scripting.&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>Sat, 06 Mar 2021 06:53:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365694#M61512</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-06T06:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: week start date</title>
      <link>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365733#M61520</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;points out, your WR_Date column must be a datetime column containing a time of day. You need to subtract that off of it to get it to a date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do that in your formula:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-03-06_09-40-20.849.png" style="width: 638px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31043i02BF2DFF3EE7CF3E/image-dimensions/638x373?v=v2" width="638" height="373" role="button" title="2021-03-06_09-40-20.849.png" alt="2021-03-06_09-40-20.849.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attached data table has an example.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Mar 2021 14:41:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/week-start-date/m-p/365733#M61520</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2021-03-06T14:41:55Z</dc:date>
    </item>
  </channel>
</rss>

