<?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: How to create subtotals for a calculated dimension? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258173#M497347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping me. This sample application is just a representation of the problem. Actual application is much more complex and table data changes dynamically, so additional static data structures barely help here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably I should find a way how to get rid of the calculated dimension, like &lt;STRONG&gt;konstantins &lt;/STRONG&gt;advised.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2011 12:56:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-10-19T12:56:32Z</dc:date>
    <item>
      <title>Subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258167#M497341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Spent a few days and couldn't find a solution -- your help is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data fields: Type, Product, Qty&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PIVOT TABLE&lt;/P&gt;&lt;P&gt;Dimensions:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;=Type&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;=if(aggr(sum(Qty),Product,Type)&amp;gt;500, '&amp;gt;500','&amp;lt;500')&amp;nbsp;&amp;nbsp;&amp;nbsp; /* labelled as Group&lt;/P&gt;&lt;P&gt;Expressions:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;=Sum(Qty)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculated dimension is grouping for Products with Sum(Qty)&amp;gt;500 and &amp;lt;500.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question: How to get subtotals for the calculated dimension to calculate percentage ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the table I have:&lt;/P&gt;&lt;P&gt;&lt;IMG /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7934" alt="Untitled.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/7934_Untitled.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the table I need to get:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="7935" alt="Capture.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/7935_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is not that so trivial as it seems -- try to play with the application (attached).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Oct 2011 16:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258167#M497341</guid>
      <dc:creator />
      <dc:date>2011-10-18T16:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258168#M497342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dmitry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In [% of Type] Expression try with this&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;=NUM(Sum(Qty) / (IF(ISNULL(AGGR(SUM(Qty),Type)),ABOVE(AGGR(SUM(Qty),Type)),AGGR(SUM(Qty),Type))),'00%')&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Do let me know, if you looking for this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 10:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258168#M497342</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-19T10:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258169#M497343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sokkorn -- it works exactly as needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, never knew about chart inter record functions -- very helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 10:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258169#M497343</guid>
      <dc:creator />
      <dc:date>2011-10-19T10:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258170#M497344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This solution works well if there are only two values in Group. What about more flexible solution -- when it could be any number of values in group?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually what is needed is to aggregate over a calculated dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Dmitry Gudkov&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 10:32:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258170#M497344</guid>
      <dc:creator />
      <dc:date>2011-10-19T10:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258171#M497345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Dmitry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use valuelist('&amp;lt;500','&amp;gt;500') in calculated dimension. And the same in the expression: if(valuelist('&amp;lt;500','&amp;gt;500')='&amp;lt;500',.....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Konstantins&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 12:01:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258171#M497345</guid>
      <dc:creator>skaredovs</dc:creator>
      <dc:date>2011-10-19T12:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258172#M497346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi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&gt;&lt;/P&gt;&lt;P&gt;[Data2]:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;IF([TotalQty]&amp;gt;500, '&amp;gt;500',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF([TotalQty]&amp;lt;=500 AND [TotalQty]&amp;gt;=400,'400-500','&amp;lt;400'))&amp;nbsp;&amp;nbsp;&amp;nbsp; AS [Range];&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type &amp;amp;' - '&amp;amp; Product&amp;nbsp;&amp;nbsp;&amp;nbsp; AS [Key],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(Qty)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AS [TotalQty]&lt;/P&gt;&lt;P&gt;RESIDENT [Data1] GROUP BY Type &amp;amp;' - '&amp;amp; Product;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Then use the second table to do with business need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This one just an idea to solve your problem. It not reply to your issue yet. So we need to do more on it. Will reply you back when I'm in office.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 12:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258172#M497346</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-19T12:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258173#M497347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sokkorn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping me. This sample application is just a representation of the problem. Actual application is much more complex and table data changes dynamically, so additional static data structures barely help here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably I should find a way how to get rid of the calculated dimension, like &lt;STRONG&gt;konstantins &lt;/STRONG&gt;advised.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2011 12:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258173#M497347</guid>
      <dc:creator />
      <dc:date>2011-10-19T12:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258174#M497348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dmitry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check my sample attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sokkorn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 04:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258174#M497348</guid>
      <dc:creator>Sokkorn</dc:creator>
      <dc:date>2011-10-20T04:51:44Z</dc:date>
    </item>
    <item>
      <title>Subtotals for a calculated dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258175#M497349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, here is the answer. Works like a charm with any number of rows in a calculated dimension, and without any additional data structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(Qty)/rangesum(top(Sum(Qty),1,NoOfRows()))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 14:17:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subtotals-for-a-calculated-dimension/m-p/258175#M497349</guid>
      <dc:creator />
      <dc:date>2011-11-01T14:17:32Z</dc:date>
    </item>
  </channel>
</rss>

