<?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: divide the time per month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007292#M1221579</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;one example that might work for you:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoWedel_1-1669065753092.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94232i64D1B2002040B197/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarcoWedel_1-1669065753092.png" alt="MarcoWedel_1-1669065753092.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;table1:
LOAD RecNo() as ID,
     Timestamp#(Reported_Date,'DD-MMM-YY hh:mm TT')	as Reported_Date,
     Timestamp#(WO_ACTFINISH,'DD-MMM-YY hh:mm TT')	as WO_ACTFINISH
Inline [
    Reported_Date, WO_ACTFINISH
    18-Jul-22 04:37 PM, 05-Sep-22 12:00 PM
    19-Jul-22 05:43 AM, 21-Aug-22 12:00 PM
    02-Aug-22 12:34 PM, 22-Sep-22 02:14 PM
    12-Aug-22 11:11 AM, 22-Aug-22 11:11 PM
    13-Aug-22 10:01 AM, 22-Dec-22 01:10 PM
];

table2:
LOAD *,
     Interval(To-From,'hh:mm') as Duration;
LOAD ID,
     MonthName(Reported_Date,IterNo()-1) as MonthYear,
     Timestamp(RangeMax(Reported_Date,MonthStart(Reported_Date,IterNo()-1)),'DD-MMM-YY hh:mm TT')	as From,
     Timestamp(RangeMin(WO_ACTFINISH, MonthStart(Reported_Date,IterNo()  )),'DD-MMM-YY hh:mm TT')	as To
Resident table1
While MonthStart(Reported_Date,IterNo()-1) &amp;lt;= WO_ACTFINISH;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 21:22:44 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2022-11-21T21:22:44Z</dc:date>
    <item>
      <title>divide the time per month</title>
      <link>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007023#M1221572</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the effort, i need support to calculate the time "difference between 2 dates" and divide the result per month&lt;/P&gt;
&lt;P&gt;for example&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ticket "reported date" 18-Jul-22 04:37 PM&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Closed"WO_Act finish" 05-Sep-22 12:00 PM&lt;/P&gt;
&lt;P&gt;the result should be &lt;STRONG&gt;48.8 days = 1171.38Hrs to close&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Now i need to divide this value so that, each month present the corresponding time spent&lt;/P&gt;
&lt;P&gt;meaning that we spend total (1171.35hrs&amp;nbsp; "319.4 Hrs in july-22" and "744Hrs in august-22" and "108hrs in September-22"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AT_3-1669034994504.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94191iFE4D08899B549F50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AT_3-1669034994504.png" alt="AT_3-1669034994504.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;AT&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>Mon, 21 Nov 2022 12:55:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007023#M1221572</guid>
      <dc:creator>A-T</dc:creator>
      <dc:date>2022-11-21T12:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: divide the time per month</title>
      <link>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007292#M1221579</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;one example that might work for you:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoWedel_1-1669065753092.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94232i64D1B2002040B197/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarcoWedel_1-1669065753092.png" alt="MarcoWedel_1-1669065753092.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;table1:
LOAD RecNo() as ID,
     Timestamp#(Reported_Date,'DD-MMM-YY hh:mm TT')	as Reported_Date,
     Timestamp#(WO_ACTFINISH,'DD-MMM-YY hh:mm TT')	as WO_ACTFINISH
Inline [
    Reported_Date, WO_ACTFINISH
    18-Jul-22 04:37 PM, 05-Sep-22 12:00 PM
    19-Jul-22 05:43 AM, 21-Aug-22 12:00 PM
    02-Aug-22 12:34 PM, 22-Sep-22 02:14 PM
    12-Aug-22 11:11 AM, 22-Aug-22 11:11 PM
    13-Aug-22 10:01 AM, 22-Dec-22 01:10 PM
];

table2:
LOAD *,
     Interval(To-From,'hh:mm') as Duration;
LOAD ID,
     MonthName(Reported_Date,IterNo()-1) as MonthYear,
     Timestamp(RangeMax(Reported_Date,MonthStart(Reported_Date,IterNo()-1)),'DD-MMM-YY hh:mm TT')	as From,
     Timestamp(RangeMin(WO_ACTFINISH, MonthStart(Reported_Date,IterNo()  )),'DD-MMM-YY hh:mm TT')	as To
Resident table1
While MonthStart(Reported_Date,IterNo()-1) &amp;lt;= WO_ACTFINISH;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 21:22:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007292#M1221579</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2022-11-21T21:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: divide the time per month</title>
      <link>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007404#M1221581</link>
      <description>&lt;P&gt;Hello marco,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for the great support i've tried the example looks good if I have a limited data "rows" unfortunately is not the case&amp;nbsp;&lt;/P&gt;
&lt;P&gt;more explanation of what i am looking for&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Reported date:&lt;/STRONG&gt;&amp;nbsp; indicate the time ticket created&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Ticked has different status (&lt;STRONG&gt;New/in progress/ closed&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;WO_ Actual finish:&lt;/STRONG&gt; always empty unless the ticket is closed&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;now i need to calculate the time spent &lt;STRONG&gt;(TTC)&lt;/STRONG&gt;&amp;nbsp; to close the ticket&lt;/P&gt;
&lt;P&gt;If the ticket closed then &lt;EM&gt;TTC= WO Act finish - Reported date&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;if the ticket in new/progress and since the WO act finish empty&amp;nbsp; then &lt;EM&gt;TTC =end of month - reported date&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and if we move to the next month and ticket still open then TTC will keep counting from the beginning of next month until we have time in WO act finish then TTC will equal WO Act finish-reported date&lt;/P&gt;
&lt;P&gt;TTC result should be divided per month/week "reporting period" as sometime the ticket opened&amp;nbsp; 28th of the month and closed 5th of next month so I need to show that I've spent 24 in this month, 36 hrs. next month and so on&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the great support hopefully this clarifies more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AT&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 07:29:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/divide-the-time-per-month/m-p/2007404#M1221581</guid>
      <dc:creator>A-T</dc:creator>
      <dc:date>2022-11-22T07:29:21Z</dc:date>
    </item>
  </channel>
</rss>

