<?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 Problem with calculated dimension and sub-total in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-calculated-dimension-and-sub-total/m-p/699460#M252533</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14129280692648354 jive_macro_code" jivemacro_uid="_14129280692648354"&gt;
&lt;P&gt;Ref:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Country, Color, Ref&lt;/P&gt;
&lt;P&gt;France, Blue, 1000&lt;/P&gt;
&lt;P&gt;France, Red, 2000&lt;/P&gt;
&lt;P&gt;France, Green, 3000&lt;/P&gt;
&lt;P&gt;France, Yellow, 4000&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Dealer:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Color, Dealer, Price&lt;/P&gt;
&lt;P&gt;Blue, Aaa, 10&lt;/P&gt;
&lt;P&gt;Red, Aaa, 11&lt;/P&gt;
&lt;P&gt;Green, Aaa, 12&lt;/P&gt;
&lt;P&gt;Yellow, Aaa, 13&lt;/P&gt;
&lt;P&gt;Blue, Bbb, 20&lt;/P&gt;
&lt;P&gt;Red, Bbb, 21&lt;/P&gt;
&lt;P&gt;Green, Bbb, 22&lt;/P&gt;
&lt;P&gt;Yellow, Bbb, 23&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where "Ref" is a reference value for each Color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make a graph for each Dealer and show:&lt;/P&gt;&lt;P&gt;- the price they sold the Color item&lt;/P&gt;&lt;P&gt;- the Ref of the Color item&lt;/P&gt;&lt;P&gt;- the subtotal of the Ref&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="rsAaabg.png" class="jive-image" src="http://i.imgur.com/rsAaabg.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the Ref is the same for every Dealer, I want to put it in a calculated dimension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14129280692624371" jivemacro_uid="_14129280692624371"&gt;
&lt;P&gt;=aggr(&lt;/P&gt;
&lt;P&gt;sum(Ref)&lt;/P&gt;
&lt;P&gt;, Color)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="atqL3o4.png" class="jive-image" src="http://i.imgur.com/atqL3o4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK, No problem, I still can have the "subtotal of the Ref".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I'ld like to add the "Country" dimension in my graph.&lt;/P&gt;&lt;P&gt;For the "subtotal of the Ref", my expression become:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14129280692597350 jive_text_macro jive_macro_code" jivemacro_uid="_14129280692597350"&gt;
&lt;P&gt;sum(total &amp;lt;Country&amp;gt; Ref)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No problem with the first type of chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sn8gkfz.png" class="jive-image" src="http://i.imgur.com/sn8gkfz.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My subtotal is 10000 on each line, that is what I expect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I want the Ref as calculated dimension (to have it in only 1 column):&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14129280692521784" jivemacro_uid="_14129280692521784"&gt;
&lt;P&gt;=aggr(&lt;/P&gt;
&lt;P&gt;sum(Ref)&lt;/P&gt;
&lt;P&gt;, Color, Country)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My subtotal becomes wrong:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="I5RnwEP.png" class="jive-image" src="http://i.imgur.com/I5RnwEP.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I don't find a way to have the "10000" value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain me why, and how I can have the "10000" value on each line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Oct 2014 08:00:44 GMT</pubDate>
    <dc:creator>nicolas_martin</dc:creator>
    <dc:date>2014-10-10T08:00:44Z</dc:date>
    <item>
      <title>Problem with calculated dimension and sub-total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-calculated-dimension-and-sub-total/m-p/699460#M252533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_14129280692648354 jive_macro_code" jivemacro_uid="_14129280692648354"&gt;
&lt;P&gt;Ref:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Country, Color, Ref&lt;/P&gt;
&lt;P&gt;France, Blue, 1000&lt;/P&gt;
&lt;P&gt;France, Red, 2000&lt;/P&gt;
&lt;P&gt;France, Green, 3000&lt;/P&gt;
&lt;P&gt;France, Yellow, 4000&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Dealer:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;Color, Dealer, Price&lt;/P&gt;
&lt;P&gt;Blue, Aaa, 10&lt;/P&gt;
&lt;P&gt;Red, Aaa, 11&lt;/P&gt;
&lt;P&gt;Green, Aaa, 12&lt;/P&gt;
&lt;P&gt;Yellow, Aaa, 13&lt;/P&gt;
&lt;P&gt;Blue, Bbb, 20&lt;/P&gt;
&lt;P&gt;Red, Bbb, 21&lt;/P&gt;
&lt;P&gt;Green, Bbb, 22&lt;/P&gt;
&lt;P&gt;Yellow, Bbb, 23&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where "Ref" is a reference value for each Color.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make a graph for each Dealer and show:&lt;/P&gt;&lt;P&gt;- the price they sold the Color item&lt;/P&gt;&lt;P&gt;- the Ref of the Color item&lt;/P&gt;&lt;P&gt;- the subtotal of the Ref&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="rsAaabg.png" class="jive-image" src="http://i.imgur.com/rsAaabg.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the Ref is the same for every Dealer, I want to put it in a calculated dimension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14129280692624371" jivemacro_uid="_14129280692624371"&gt;
&lt;P&gt;=aggr(&lt;/P&gt;
&lt;P&gt;sum(Ref)&lt;/P&gt;
&lt;P&gt;, Color)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="atqL3o4.png" class="jive-image" src="http://i.imgur.com/atqL3o4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK, No problem, I still can have the "subtotal of the Ref".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I'ld like to add the "Country" dimension in my graph.&lt;/P&gt;&lt;P&gt;For the "subtotal of the Ref", my expression become:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14129280692597350 jive_text_macro jive_macro_code" jivemacro_uid="_14129280692597350"&gt;
&lt;P&gt;sum(total &amp;lt;Country&amp;gt; Ref)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No problem with the first type of chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sn8gkfz.png" class="jive-image" src="http://i.imgur.com/sn8gkfz.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My subtotal is 10000 on each line, that is what I expect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I want the Ref as calculated dimension (to have it in only 1 column):&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14129280692521784" jivemacro_uid="_14129280692521784"&gt;
&lt;P&gt;=aggr(&lt;/P&gt;
&lt;P&gt;sum(Ref)&lt;/P&gt;
&lt;P&gt;, Color, Country)&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My subtotal becomes wrong:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="I5RnwEP.png" class="jive-image" src="http://i.imgur.com/I5RnwEP.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I don't find a way to have the "10000" value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain me why, and how I can have the "10000" value on each line?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 08:00:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-calculated-dimension-and-sub-total/m-p/699460#M252533</guid>
      <dc:creator>nicolas_martin</dc:creator>
      <dc:date>2014-10-10T08:00:44Z</dc:date>
    </item>
  </channel>
</rss>

