<?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 past months data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804362#M1031824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to replace a blank [Last Resolved Date] with Today() in some of the expressions. I would do the following (but I cannot test it since I don't have source data, so beware of bugs...) This way, also incidents that are still open will have an end date for the range: Today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leave the first table as it is. Change the second table to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Months:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; MonthEnd(AddMonths(MonthStart([Submit Date]),IterNo()-1)) &amp;lt; &lt;STRONG style="color: #ff0000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;RangeMin( Today() +1, [Last Resolved Date] )&lt;/STRONG&gt; as Open,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; IterNo() = 1 as IsSubmissionMonth,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Date(AddMonths(MonthStart([Submit Date]),IterNo()-1),'YYYY MMM') as Month,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; [Incident Number]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Resident Incidents&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; While MonthEnd(AddMonths(MonthStart([Submit Date]),IterNo()-1)) &amp;lt;= &lt;STRONG style="color: #ff0000;"&gt;RangeMin( Today(), MonthEnd([Last Resolved Date]) )&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2015 11:18:39 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2015-02-06T11:18:39Z</dc:date>
    <item>
      <title>Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804357#M1031819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to calculate the &lt;SPAN style="text-decoration: underline;"&gt;percentage of tickets that are open at the end of every month.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Formula is&lt;/STRONG&gt; : % open = count of tickets open at end of month/count of tickets submitted in that month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BUT&lt;/STRONG&gt; the challenge arises when the tickets are resolved and I want to show the open tickets for older months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance if I were to look/calculate for a particular month in the past now, say November 2014;&lt;/P&gt;&lt;P&gt;I will count all the tickets with &lt;STRONG&gt;"Submit Date" &amp;lt; November but with Resolved Date &amp;gt; November,2014 or empty (ie. still open in February).&lt;/STRONG&gt; Once I get this I can divide this by the count of tickets submitted in November to get the percentage I'm looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Fields are :&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SubmitDate&lt;/LI&gt;&lt;LI&gt;ResolvedDate (will be empty for still open tickets)&lt;/LI&gt;&lt;LI&gt;IncidentID&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone please help me set this expression on my chart? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 10:30:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804357#M1031819</guid>
      <dc:creator />
      <dc:date>2015-02-02T10:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804358#M1031820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you attached your file?&lt;/P&gt;&lt;P&gt;Excel or qvq&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 11:00:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804358#M1031820</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-02-02T11:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804359#M1031821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;Thanks for the reply. Please find attached file as requested, I have added only the relevant&amp;nbsp; fields to cut down on the size.&lt;/P&gt;&lt;P&gt;Also I'm including the expected chart as i make in Excel for your reference please.&lt;IMG __jive_id="76869" alt="Carry Forward Tickets_Sample.jpg" class="image-1 jive-image" src="/legacyfs/online/76869_Carry Forward Tickets_Sample.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Hoping to hear on your solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 11:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804359#M1031821</guid>
      <dc:creator />
      <dc:date>2015-02-02T11:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804360#M1031822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would solve this in the data model, by generating all months between the submission and the resolution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Incidents:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Submit Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Last Resolved Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp; Floor([Last Resolved Date] - [Submit Date]) as DaysOpen, &lt;/P&gt;&lt;P&gt;&amp;nbsp; [Service Line],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Incident Number]&lt;/P&gt;&lt;P&gt;FROM [Raw_Sample_for QV Blog v4.xlsx] (ooxml, embedded labels, table is Sheet3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Months: // Months between the submit date and resolved date&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp; MonthEnd(AddMonths(MonthStart([Submit Date]),IterNo()-1)) &amp;lt; [Last Resolved Date] as Open,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IterNo() = 1 as IsSubmissionMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(AddMonths(MonthStart([Submit Date]),IterNo()-1),'YYYY MMM') as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Incident Number]&lt;/P&gt;&lt;P&gt;&amp;nbsp; Resident Incidents&lt;/P&gt;&lt;P&gt;&amp;nbsp; While MonthEnd(AddMonths(MonthStart([Submit Date]),IterNo()-1)) &amp;lt;= MonthEnd([Last Resolved Date]) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the above script, you can use Month as dimension and the following two expressions to calculate the number of open cases and the number of submitted cases:&lt;/P&gt;&lt;P&gt;* Count ({$&amp;lt;Open={'-1'}&amp;gt;} distinct [Incident Number])&lt;/P&gt;&lt;P&gt;* Count ({$&amp;lt;IsSubmissionMonth={'-1'}&amp;gt;} distinct [Incident Number])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, my numbers are different from your graph, so you should check them...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Image1.png" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/77106_Image1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 13:09:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804360#M1031822</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2015-02-04T13:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804361#M1031823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henric,&lt;/P&gt;&lt;P&gt;Thanks for this amazing reply. It took me some time to understand the code. Everything is working good but in my raw data provided earlier, I had stripped some data to reduce the size, hence I did not supply the tail end of the data where &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;"Last Resolved Date" is blank&lt;/STRONG&gt;&lt;/SPAN&gt; since it is unresolved and still open.&lt;/P&gt;&lt;P&gt;As a result the code is not capturing those tickets where "Last Resolved Date" is blank. &lt;STRONG&gt;This is because the iteration for While function is counting only till the &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&amp;lt;= MonthEnd([Last Resolved Date]) (?)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I did try using my logic for a workaround, but failed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Could you please help me with this little niggle?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting with anticipation.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804361#M1031823</guid>
      <dc:creator />
      <dc:date>2015-02-06T11:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804362#M1031824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to replace a blank [Last Resolved Date] with Today() in some of the expressions. I would do the following (but I cannot test it since I don't have source data, so beware of bugs...) This way, also incidents that are still open will have an end date for the range: Today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leave the first table as it is. Change the second table to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Months:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; MonthEnd(AddMonths(MonthStart([Submit Date]),IterNo()-1)) &amp;lt; &lt;STRONG style="color: #ff0000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;RangeMin( Today() +1, [Last Resolved Date] )&lt;/STRONG&gt; as Open,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; IterNo() = 1 as IsSubmissionMonth,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Date(AddMonths(MonthStart([Submit Date]),IterNo()-1),'YYYY MMM') as Month,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; [Incident Number]&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; Resident Incidents&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; While MonthEnd(AddMonths(MonthStart([Submit Date]),IterNo()-1)) &amp;lt;= &lt;STRONG style="color: #ff0000;"&gt;RangeMin( Today(), MonthEnd([Last Resolved Date]) )&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:18:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804362#M1031824</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2015-02-06T11:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804363#M1031825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henric,&lt;/P&gt;&lt;P&gt;Smart and wonderful workaround. The logic is working just fine.&lt;/P&gt;&lt;P&gt;Thanks a ton,&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tony &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 12:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804363#M1031825</guid>
      <dc:creator />
      <dc:date>2015-02-09T12:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic calculation for past months data</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804364#M1031826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henric,&lt;/P&gt;&lt;P&gt;Continuing from here, I have doubts regarding how to show the chart as per certain condensations. Could you please have a look into &lt;A href="https://community.qlik.com/thread/151550"&gt;Dynamic Chart with conditional showcase of months&lt;/A&gt; and come up with your expert advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always awaiting with anticipation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 10:30:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-calculation-for-past-months-data/m-p/804364#M1031826</guid>
      <dc:creator />
      <dc:date>2015-02-11T10:30:42Z</dc:date>
    </item>
  </channel>
</rss>

