<?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: Col sum comparing dates/time in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14443#M13484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made it work, thank you mdawson69 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Oct 2015 02:39:08 GMT</pubDate>
    <dc:creator>fmcortes1</dc:creator>
    <dc:date>2015-10-07T02:39:08Z</dc:date>
    <item>
      <title>Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14436#M13477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am trying to identify how to add values if they are within a certain range, i have tried col sum but I do not know how to do compare the table values, (new to scripting &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" src="https://kvoqx44227.lithium.com/7.0.4.3b79b96/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;the idea is that i have customers coming in at a certain time, stay for x minutes and leave, as the get in to the area, occupancy (number of customers) increase, if they are together within a certain time range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd really appreciate guidance, thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FC&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10025_pastedImage_1.png" style="width: 614px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2214iBEF4930464A3AE25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10025_pastedImage_1.png" alt="10025_pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:43:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14436#M13477</guid>
      <dc:creator>fmcortes1</dc:creator>
      <dc:date>2016-10-19T00:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14437#M13478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your inquiry is in line with a test that I have to build for our Model Development project. Your wording is a little confusing, but I surmise that what you effectively need to do is create an occupancy table based on the entry and exit events at a service location for each customer. The occupancy at any given time is complicated by the interdependence of each customer's exit time which may span several entry events. This is a typical simulation modeling problem when attempting to determine utilization, which is a level above what you are attempting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before showing the necessary script, I will walk you through the process.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10084_Table 1.png" style="width: 1554px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2234iDC27CF77E55C6836/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10084_Table 1.png" alt="10084_Table 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First, I created a data table similar to your example. In this form the data is agent-centric with the entry and exit events recorded in the same row. We need to separate the events by stacking the events.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10086_Table 2.png" style="width: 1554px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2235i56895E6DE345DF70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10086_Table 2.png" alt="10086_Table 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now the events have been separated, but by default they are still grouped by the Agent. We need the events in order by time, so the data table needs to be sorted. Before sorting, we also need to make sure that exits occur before entries. The latter may not be important for your purpose, but we always deal with systems with limited capacity, so entry and exit events that have the same timestamp need to be ordered as exit then entry, as the it is most likely that an agent exits a location before a new agent enters. Once that is done we sort the data table by Time and Action.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10087_Table 3.png" style="width: 1554px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2236i02843ADBB894F634/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10087_Table 3.png" alt="10087_Table 3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now that the events are in the proper order, a column can be added to track occupancy.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10088_Table 4.png" style="width: 1554px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2237i9FCEE79927F7835C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10088_Table 4.png" alt="10088_Table 4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The Occupancy column has a formula that determines the occupancy in each row based on the previous occupancy and the action in the current row. The formula also assumes that the first row is the first entry—it should be—and sets the occupancy to 1 for the first row. Now we need to split the table so that we get the original table orientation back with the occupancy reported.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10089_Table 5.png" style="width: 1554px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2238i501264358CF299B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10089_Table 5.png" alt="10089_Table 5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The Occupancy column now shows the occupancy based on each entry, but also accounts for previous exits from the service location. The split operation placed the Occupancy column after the Agent ID column, so the script will move it to the last column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #032ce4;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;Names Default to Here&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #032ce4;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Current Data Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #011993;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&amp;lt;&amp;lt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Stack&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Columns&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Entry&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Exit&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Source Label Column&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #942193;"&gt;"Action"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Stacked Data Column&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #942193;"&gt;"Time"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #008f00;"&gt;&lt;SPAN style="color: #333333; font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Close&lt;/SPAN&gt;(dt, NoSave);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #032ce4;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt2 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Current Data Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #942193;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt2&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;Action &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Set Property&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;"Value Ordering"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;"Exit"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;"Entry"&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;})&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;dt2 &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Sort&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; By&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Time&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Action&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Ascending&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Replace Table&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #011993;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt2 &lt;/SPAN&gt;&amp;lt;&amp;lt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;New Column&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #942193;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;"Occupancy"&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Formula&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;If&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Row&lt;/SPAN&gt;&lt;STRONG&gt;()&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;If&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Action &lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"Entry"&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Lag&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Occupancy&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;+&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;Lag&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Occupancy&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;-&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #011993;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt2 &lt;/SPAN&gt;&amp;lt;&amp;lt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Split&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Split By&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Action&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Split&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Time&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; Group&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Agent ID&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #032ce4;"&gt;Close&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;dt2&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; NoSave&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #032ce4;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt3 &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Current Data Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; min-height: 13px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; color: #011993;"&gt;&lt;SPAN style="font-family: terminal, monaco;"&gt;&lt;SPAN style="color: #000000;"&gt;dt3 &lt;/SPAN&gt;&amp;lt;&amp;lt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Move Selected Columns&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;({&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"Occupancy"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN style="color: #000000;"&gt; To Last&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:46:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14437#M13478</guid>
      <dc:creator>mdawson69</dc:creator>
      <dc:date>2016-10-19T00:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14438#M13479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is great! Thanks a lot, I was able to make it work "step by step", for some reason the script did not work as expected, I guess I need to study a little bit more.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 03:01:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14438#M13479</guid>
      <dc:creator>fmcortes1</dc:creator>
      <dc:date>2015-10-01T03:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14439#M13480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the input.&lt;/P&gt;&lt;P&gt;I was wondering similar solutions for our occupancy which in this case is a Room Occupancy in Hotel Management.&lt;/P&gt;&lt;P&gt;I have the Check In Date and Check Out Date. When they check in it means they occupied a room and the number of rooms are limited to 516.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How could I calculate row by row the Occupancy in % (number of rooms occupied/516).&lt;/LI&gt;&lt;LI&gt;how could I calculate the number of rooms occupied for each given day&lt;/LI&gt;&lt;LI&gt;Furthermore how could I calculate the occupancy by AgencyGroup&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10094_Screen Shot 2015-10-01 at 10.30.05.png" style="width: 355px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2242iC6CD62DAA4CF6D39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10094_Screen Shot 2015-10-01 at 10.30.05.png" alt="10094_Screen Shot 2015-10-01 at 10.30.05.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 00:46:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14439#M13480</guid>
      <dc:creator>saitcopuroglu</dc:creator>
      <dc:date>2016-10-19T00:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14440#M13481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What were the issues you had running the script? My sample data table has less variables (columns) than yours, so offhand, I know that one issue you would encounter is if you strictly followed my script would be retaining all of the columns through the process. That would require a relatively minor tweak to the code to ensure that all columns are included when new data tables are created in through the process.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 10:31:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14440#M13481</guid>
      <dc:creator>mdawson69</dc:creator>
      <dc:date>2015-10-01T10:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14441#M13482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial;"&gt;&lt;SPAN style="font-size: 10pt; font-family: helvetica;"&gt;Once you factor in the constraint of a maximum service level—in this case the maximum number of hotel rooms that may be occupied—you are no longer discussing occupancy, as that is simply the count of occupied rooms at some time. Your first bullet point is utilization, which at time &lt;EM&gt;t&lt;/EM&gt; is defined as,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial; text-align: center;"&gt;&lt;SPAN style="font-size: 10pt; font-family: helvetica;"&gt;occupancy ÷ total room count&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial;"&gt;&lt;SPAN style="font-size: 10pt; font-family: helvetica;"&gt;So you would add a column with that formula.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial;"&gt;&lt;SPAN style="font-size: 10pt; font-family: helvetica;"&gt;The remaining bullet points fall under “define your requirements,” which is an issue we often have here with some of our clients. I have learned that with inquiries such as this, make sure I know what the client expects before assuming that I know what they mean. &lt;/SPAN&gt;&lt;SPAN style="font-family: helvetica; font-size: 10pt; -webkit-text-stroke-width: initial;"&gt;For example, the way one of our clients defines wait time—known as delay in simulation modeling—is very different from the way the same metric is defined in most discrete-event simulation texts, let alone what most simulation software reports. Their definition is not wrong—it is very much contextual—but it is not the standard definition of delay.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial;"&gt;&lt;SPAN style="font-size: 10pt; font-family: helvetica;"&gt;“&lt;EM&gt;How could I calculate the number of rooms occupied for each given day.&lt;/EM&gt;” &lt;/SPAN&gt;&lt;SPAN style="font-family: helvetica; font-size: 10pt; -webkit-text-stroke-width: initial;"&gt;Are you asking for a daily running occupancy or a summary of the maximum occupancy for each day?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial; min-height: 13px;"&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 11px; line-height: normal; font-family: Helvetica; -webkit-text-stroke-color: #000000; -webkit-text-stroke-width: initial;"&gt;&lt;SPAN style="font-size: 10pt; font-family: helvetica;"&gt;“&lt;EM&gt;Furthermore how could I calculate the occupancy by AgencyGroup&lt;/EM&gt;”&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: helvetica; font-size: 10pt; -webkit-text-stroke-width: initial;"&gt;Same as above.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 12:09:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14441#M13482</guid>
      <dc:creator>mdawson69</dc:creator>
      <dc:date>2015-10-01T12:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14442#M13483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe it is more an issue with my knowledge with scripting than with the script itself! I will read a little bit more how to implement scripts to try it, I will let you know once it works. Thanks again for your support! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Oct 2015 03:11:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14442#M13483</guid>
      <dc:creator>fmcortes1</dc:creator>
      <dc:date>2015-10-02T03:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14443#M13484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made it work, thank you mdawson69 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2015 02:39:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14443#M13484</guid>
      <dc:creator>fmcortes1</dc:creator>
      <dc:date>2015-10-07T02:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Col sum comparing dates/time</title>
      <link>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14444#M13485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to help. As I stated in my original post, your inquiry made me look into something that I will soon need to look into for the project I am currently working on. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Oct 2015 11:50:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Col-sum-comparing-dates-time/m-p/14444#M13485</guid>
      <dc:creator>mdawson69</dc:creator>
      <dc:date>2015-10-07T11:50:05Z</dc:date>
    </item>
  </channel>
</rss>

