<?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: Calculate Quota expression by Fact values in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883669#M308201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(TOTAL &amp;lt;Collection, Category, Group, Subgroup&amp;gt; Aggr(If(Sum(Fact) &amp;gt; 0, Sum(Quota)), Collection, Category, Group, Subgroup))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90405_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/90406_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2015 14:34:12 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-06-23T14:34:12Z</dc:date>
    <item>
      <title>Calculate Quota expression by Fact values in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883668#M308200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi frends !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I faced the next problem. I need to show Quota on by Fact values in Pivot Table on the all levels of aggregations. How I can do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the screenshot below chart "1" Quota and Fact expressions, but if we hide Quota expression, in Fact there will be no zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In chart "2" - look's like result what we need, BUT it works on the 4 and 3 level of Dimentionality(), because we wrote, the next expression:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14350647426786354 jive_text_macro" jivemacro_uid="_14350647426786354"&gt;
&lt;P&gt;If("Fact"&amp;gt;0,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Max( TOTAL&amp;lt;Collection, Category, Group, Subgroup&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Aggr(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sum (Quota)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; , Collection, Category, Group, Subgroup)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it dont works when we looking at "Quota" on Category and Collection level.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="90388" alt="3.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90388_3.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error looks like here:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="90408" alt="4.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/90408_4.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Because expression we wrote to Quota stops working when the Fact &amp;gt; 0, and when we drill down to the Collection and Category, Fact still &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So hope that clearly explaned the current problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be we need to use the calculated dimention, but how i'll be aggregating Quota expression by calculated dimention?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help! Help me to find the right way to write expression for Quota.&lt;/P&gt;&lt;P&gt;Any advices, solutions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final result shoul look like here:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="90410" alt="5.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/90410_5.png" style="height: auto;" /&gt;and&lt;IMG __jive_id="90412" alt="6.png" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/90412_6.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another words we need to say to the Quota expression: Look at the last &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;granular level, find only Fact &amp;gt; 0 and show Quota only by those fields (values of fields), where Fact &amp;gt; 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Demo source in attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 14:02:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883668#M308200</guid>
      <dc:creator>lylererger</dc:creator>
      <dc:date>2015-06-23T14:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Quota expression by Fact values in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883669#M308201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(TOTAL &amp;lt;Collection, Category, Group, Subgroup&amp;gt; Aggr(If(Sum(Fact) &amp;gt; 0, Sum(Quota)), Collection, Category, Group, Subgroup))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90405_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/90406_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 14:34:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883669#M308201</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-23T14:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Quota expression by Fact values in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883670#M308202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh so you still want to see the 0's when you have the Group and Subgroup Expanded???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that the goal?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 14:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883670#M308202</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-23T14:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Quota expression by Fact values in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883671#M308203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if you use Min instead of Max?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min(TOTAL &amp;lt;Collection, Category, Group, Subgroup&amp;gt; Aggr(Sum(Quota), Collection, Category, Group, Subgroup))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 14:44:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883671#M308203</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-06-23T14:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Quota expression by Fact values in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883672#M308204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IF "Sum(Fact)" have big Formula with "AGGR" and other functions, method by &lt;SPAN style="font-size: 11.6999998092651px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;A href="https://community.qlik.com/people/sunindia"&gt;sunindia&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt; don`t work.&lt;/P&gt;&lt;P&gt;This method will work with big formulas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) we create "Variable" For string with only true Subgroup(last DIM in AGGR functions)&lt;/P&gt;&lt;P&gt;vTest = CHR(39)&amp;amp;CONCAT(IF( Aggr(Sum (Fact) , Collection, Category, Group, Subgroup) &amp;gt;0, Subgroup),CHR(39)&amp;amp;','&amp;amp;CHR(39))&amp;amp;CHR(39)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Add to "set analysis" in "Sum (Quota)". =&amp;gt; Sum ({&amp;lt;Subgroup={$(vTest)}&amp;gt;} Quota)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now in set analysis, we will take only &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Subgroups where "&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Sum (Fact)&amp;gt;0".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 15:11:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883672#M308204</guid>
      <dc:creator />
      <dc:date>2015-06-23T15:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Quota expression by Fact values in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883673#M308205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using complex formula for Fact with Aggr func, then aggr(sum(aggr(sum...doesn't works...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the final solution - is to use peace of SunIndia logic "&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(Sum(Fact) &amp;gt; 0&lt;/STRONG&gt;" and Max logic with variable "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;CHR(39)&amp;amp;CONCAT(IF( Aggr(Sum (Fact) , Collection, Category, Group, Subgroup) &amp;gt;0, Subgroup),CHR(39)&amp;amp;','&amp;amp;CHR(39))&amp;amp;CHR(39)&lt;/SPAN&gt;" to. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks a lot for yous help.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 17:38:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Quota-expression-by-Fact-values-in-Pivot-Table/m-p/883673#M308205</guid>
      <dc:creator>lylererger</dc:creator>
      <dc:date>2015-06-23T17:38:13Z</dc:date>
    </item>
  </channel>
</rss>

