<?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: create a column indicating the shift in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579503#M77881</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;I think I didn't explain well what I want, I'm looking to make a bar chart where I can show the average cycle time per shift. I had an idea but I don't know if it's the best option, which is to create an extra column in my global table and identify which shift my cycle time is in. example if it is between 05:00 to 12:00 = T1 if it is from 12:01 to 22:00 = T2 and until 22:01 to 05:00 = T3. Is it possible to do that? Is it the most viable option ?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682367432462.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516752i61400D4388223D88/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682367432462.png" alt="1682367432462.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Image.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520105iCCE35EDEC2F957CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image.png" alt="Image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 24 Apr 2023 20:17:49 GMT</pubDate>
    <dc:creator>Kauan</dc:creator>
    <dc:date>2023-04-24T20:17:49Z</dc:date>
    <item>
      <title>create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579501#M77879</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 21.2.4 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I have a global table that takes some data from sql server that brings me all the data but I would like to make a graph where I can see the performance of the morning, afternoon and night shifts. Is it possible in the charts to create a filter by date?&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 Apr 2023 13:33:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579501#M77879</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-23T13:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579502#M77880</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;What data exactly do you want to plot in a chart: The data from your global table, the state/utilization of objects, a throughput value, ...?&lt;/P&gt;&lt;P&gt;In general, if you have time stamps, you can use the &lt;A rel="noopener noreferrer" id="isPasted" href="https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html#Property-hour" target="_blank"&gt;datetime&lt;/A&gt; class to create a column that denotes the shift the data point belongs to by using simple conditions like "DateTime(...).hour &amp;gt;= 8 &amp;amp;&amp;amp; DateTime(...).hour &amp;lt; 16".&lt;/P&gt;&lt;P&gt;Once you have such a column you can partition the data by it, either in a calculated table if you need to filter/aggregate the other data first, or directly through the properties of certain chart types.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Apr 2023 07:37:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579502#M77880</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-04-24T07:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579503#M77881</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;I think I didn't explain well what I want, I'm looking to make a bar chart where I can show the average cycle time per shift. I had an idea but I don't know if it's the best option, which is to create an extra column in my global table and identify which shift my cycle time is in. example if it is between 05:00 to 12:00 = T1 if it is from 12:01 to 22:00 = T2 and until 22:01 to 05:00 = T3. Is it possible to do that? Is it the most viable option ?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682367432462.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516752i61400D4388223D88/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682367432462.png" alt="1682367432462.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Image.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520105iCCE35EDEC2F957CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image.png" alt="Image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Apr 2023 20:17:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579503#M77881</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-24T20:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579504#M77882</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;That is pretty much what I tried to describe in my comment. The code to determine would look something like this (missing the reference to the table that you would have to provide).&lt;/P&gt;&lt;PRE&gt;Table current = Table("GlobalTable1");
for(int row = 1; row &amp;lt;= current.numRows; row++)
{
&amp;nbsp; &amp;nbsp; DateTime entryTime = DateTime(current[row]["InputTimestamp"]);
&amp;nbsp; &amp;nbsp; if(entryTime.hour &amp;gt;= 5 &amp;amp;&amp;amp; entryTime.hour &amp;lt; 12)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current[row][3] = 1;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; if(entryTime.hour &amp;gt;= 12 &amp;amp;&amp;amp; entryTime.hour &amp;lt; 22)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current[row][3] = 2;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; continue;
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; current[row][3] = 3;
}&lt;/PRE&gt;&lt;P&gt;This code loops through the entire table. If you add the entries one by one you can of course directly compute the shift for just that row.&lt;/P&gt;&lt;P&gt;To then get the average into a bar chart you can use a calculated table to get the average value of the &lt;EM&gt;Difference&lt;/EM&gt; column partitioned by the shift.&lt;/P&gt;&lt;P&gt;Either use the options on the first and third tab to generate the query or enable the direct editing to type it in manually.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682404458679.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516753iB4CCFF93D906B5B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682404458679.png" alt="1682404458679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 06:35:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579504#M77882</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-04-25T06:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579505#M77883</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;in the code above it changes the value of my inputTimestap, how do I change the shift column. Another thing I will share the model, would you show me this calculated field better?&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682420768440.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516754i1D9CD0A7A7B5E053/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682420768440.png" alt="1682420768440.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1682420787659.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516755i3371D9E71D65FB66/image-size/large?v=v2&amp;amp;px=999" role="button" title="1682420787659.png" alt="1682420787659.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/67489-busca-de-dados-3-autosave-jl3-autosave.fsm" target="_blank"&gt;busca-de-dados-3-autosave-jl3_autosave.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 11:06:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579505#M77883</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-25T11:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579506#M77884</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can use this to set your shift number if shifts 1,2 and 3 correspond to 0-8hrs, 8-16hrs, 16-24hrs:&lt;/P&gt;&lt;PRE&gt;Table.query("UPDATE GlobalTable1 SET Shift = 1+(DateTime(InputTimestamp).hour&amp;gt;=8)+(DateTime(InputTimestamp).hour&amp;gt;=16)");&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 11:45:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579506#M77884</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-04-25T11:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579507#M77885</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;In my example model the Shift column was the third one in the table. You have the change the column number/name when assigning the shift values to reflect your table format.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 12:26:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579507#M77885</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-04-25T12:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579508#M77886</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; &lt;/P&gt;
 &lt;P&gt;Thank you very much.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 14:06:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579508#M77886</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-25T14:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579509#M77887</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P id="isPasted"&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Thank you very much.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 14:06:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579509#M77887</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-25T14:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579510#M77888</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;One last doubt, I realized that both methods work and if I wanted to get a time with minutes. Example 12:30 what do i need to change to do this.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 17:38:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579510#M77888</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-25T17:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579511#M77889</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;One last doubt, I realized that both methods work and if I wanted to get a time with minutes. Example 12:30 what do i need to change to do this.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 17:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579511#M77889</guid>
      <dc:creator>Kauan</dc:creator>
      <dc:date>2023-04-25T17:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: create a column indicating the shift</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579512#M77890</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You could add the minutes to the different conditions (DateTime.minute). But I would suggest to calculate the current time of day as a decimal hour value and compare the shift times to that.&lt;/P&gt;&lt;P&gt;As an example&lt;/P&gt;&lt;PRE&gt;&lt;P&gt;DateTime entryTime = DateTime(current[row]["InputTimestamp"]):
double timeOfDay = entryTime.hour + entryTime.minute/60;
if(entryTime.hour &amp;gt;= 5 &amp;amp;&amp;amp; entryTime.hour &amp;lt; 12.5)
{ &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; current[row]["Shift"] = 1; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; continue;
}
...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Apr 2023 19:45:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/create-a-column-indicating-the-shift/m-p/13579512#M77890</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-04-25T19:45:52Z</dc:date>
    </item>
  </channel>
</rss>

