<?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: Dynamic Calculation for Utilization in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86921#M509481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your solution you are giving soultion for specific dates, I dont know what time period will be selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need something more generic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2018 11:03:29 GMT</pubDate>
    <dc:creator>kfir1987</dc:creator>
    <dc:date>2018-08-01T11:03:29Z</dc:date>
    <item>
      <title>Dynamic Calculation for Utilization</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86919#M509479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to calculate utilization for working hours in a certain period of time. As you know utilization formula is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;actual working hours / total hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is to calculate the&lt;STRONG&gt; total &lt;/STRONG&gt;hours field , because it can be in quarters or years ... another example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let say I want to calculate the total time for this quarter (Q3 - 2018) but the quarter still not ended (we have two more month to finish the quarter). So the total time (lets calculate it in days) is 31 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Of course the utilization should be change based on user selection, in case the user selected Q2 2018 than the user will see the utilization for Q2 2018 but in case Q3 2018 choose than the user will see relative utilization until current moment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Note: my time frame is minute&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So my need is to find a way to calculate dynamic field for total working hours &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 12:16:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86919#M509479</guid>
      <dc:creator>kfir1987</dc:creator>
      <dc:date>2018-07-31T12:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Calculation for Utilization</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86920#M509480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set TimestampFormat = 'M/D/YY hh:mm TT';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set vHol = '41130,41140';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD *, recno() as ID INLINE [&lt;/P&gt;&lt;P&gt;DT1, DT2&lt;/P&gt;&lt;P&gt;6/9/18 11:08 AM,6/9/18 2:57 PM&lt;/P&gt;&lt;P&gt;6/18/18 09:20 AM,6/20/18 01:13 PM&lt;/P&gt;&lt;P&gt;6/17/18 09:20 AM,6/20/18 01:13 PM&lt;/P&gt;&lt;P&gt;6/17/18 09:20 AM,6/19/18 01:13 PM&lt;/P&gt;&lt;P&gt;5/27/18 12:41 PM,5/6/18 4:38 PM&lt;/P&gt;&lt;P&gt;5/29/18 4:45 PM,5/6/18 4:19 PM&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;5/1/18 09:00 AM,5/3/18 10:00 AM&lt;/P&gt;&lt;P&gt;5/3/18 03:00 PM,5/6/18 09:00 AM&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TMP:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;daystart(DT1)+iterno()-1 as Date,&lt;/P&gt;&lt;P&gt;if(iterno()=1, rangemin(rangemax(frac(DT1),maketime(8)),maketime(18)), maketime(8)) as Start,&lt;/P&gt;&lt;P&gt;if(daystart(DT1)+iterno()-1=daystart(DT2), rangemax(maketime(8),rangemin(frac(DT2),maketime(18))),Maketime(18)) as End&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident INPUT&lt;/P&gt;&lt;P&gt;while daystart(DT2) &amp;gt;= daystart(DT1)+iterno()-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;left join (INPUT)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;ID,&lt;/P&gt;&lt;P&gt;interval(sum(End-Start)) as Duration&lt;/P&gt;&lt;P&gt;Resident TMP&amp;nbsp; where WeekDay(Date)&amp;lt;5 and not match(Date,$(vHol))&amp;nbsp;&amp;nbsp; group by ID;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table TMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to the weekends, you can also exclude holidays from the interval calculation, by adding your holidays to the vHol variable (you can create this variable from a holiday table, there are some posts here on how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then create a record per date in each interval and assign the start and end times per date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to adjust the timestamp format to your format used, check the format codes in the Help if needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Map_MechToHours:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mapping Load&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MechanicID&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,HoursAvailable&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; From OPS_CF;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load *&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , ApplyMap('Map_MechToHours', MechanicID)/hoursWorkedOnWorkOrder as PercentTimeWorked&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident OPS_WRCF;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use your new metric PercentTimeWorked much easier in the front end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:22:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86920#M509480</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-07-31T14:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Calculation for Utilization</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86921#M509481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your solution you are giving soultion for specific dates, I dont know what time period will be selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need something more generic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 11:03:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Calculation-for-Utilization/m-p/86921#M509481</guid>
      <dc:creator>kfir1987</dc:creator>
      <dc:date>2018-08-01T11:03:29Z</dc:date>
    </item>
  </channel>
</rss>

