<?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 Monthly quota and parametrize variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127804#M371056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just dealing with a concept of monthly quotas in my Qv application. I found a nice way to code-one-use-many by creating a variable with $1 where I have to place the quota, it works properly when the scope is monthly, and also in daily. The problem comes when I get yearly overview, it does it correctly per month basis but the year sum shows a bit more than the quota, is not a blocking problem because the scope is monthly based and when I select the month it gets me the correct sum, but before I get in production I'll like to hear some experiences related to that topic, as I might introducing a potential error I'm not aware yet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach the qvw with the formula used for the monthly quota.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question, is it correct the approach I use for calculating a monthly quota that can be also applicable to a daily basis? If not, what would be the best approach for such cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Julio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Aug 2016 08:16:25 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-08-04T08:16:25Z</dc:date>
    <item>
      <title>Monthly quota and parametrize variable</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127804#M371056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just dealing with a concept of monthly quotas in my Qv application. I found a nice way to code-one-use-many by creating a variable with $1 where I have to place the quota, it works properly when the scope is monthly, and also in daily. The problem comes when I get yearly overview, it does it correctly per month basis but the year sum shows a bit more than the quota, is not a blocking problem because the scope is monthly based and when I select the month it gets me the correct sum, but before I get in production I'll like to hear some experiences related to that topic, as I might introducing a potential error I'm not aware yet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach the qvw with the formula used for the monthly quota.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question, is it correct the approach I use for calculating a monthly quota that can be also applicable to a daily basis? If not, what would be the best approach for such cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Julio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 08:16:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127804#M371056</guid>
      <dc:creator />
      <dc:date>2016-08-04T08:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly quota and parametrize variable</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127805#M371057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you check now, if this looks better&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 16:26:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127805#M371057</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-04T16:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Monthly quota and parametrize variable</title>
      <link>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127806#M371058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your update, I actually manage to fix it by the end of my work day. My plan was publishing the answer, so here it goes! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my mistake was that I used Count(Day) instead of Count(dDay).&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Correct formula:&lt;/P&gt;
&lt;P&gt;Count(Distinct dDate)*$1*(1 + Year(Max(dDate)) - Year(Min(dDate)) + Month(Max(dDate)) - Month(Min(dDate)))/Ceil(Monthend(Max(dDate)) - Monthstart(Min(dDate)))&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My granularity is in day, the quota is based on monthly view, so what I do, I calculate the quota for one day&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;$1*(1&lt;/P&gt;
&lt;P&gt;+ Year(Max(dDate)) - Year(Min(dDate)) + Month(Max(dDate)) -&lt;/P&gt;
&lt;P&gt;Month(Min(dDate)))/Ceil(Monthend(Max(dDate)) - Monthstart(Min(dDate)))&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and then I multiply for the amount of days the dimension has&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Count(Distinct dDate)&lt;/P&gt;


&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and there was my mistake, I didn't count the days in the dimension, I calculated the days in the month/months that it can be 28 or 29 or 30 or 31, when actually I need the sum of all days in each month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now for a full year with a monthly quota of 3000 you get 36000 &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Julio !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 06:30:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Monthly-quota-and-parametrize-variable/m-p/1127806#M371058</guid>
      <dc:creator />
      <dc:date>2016-08-05T06:30:14Z</dc:date>
    </item>
  </channel>
</rss>

