<?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: Calculated DImension IF Sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127473#M370995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A global TOTAL will work but if you need a TOTAL on a certain dimension-level you couldn't do it with a calculated dimension. In this case you need to use an adjusted version of the expression from the calculated dimension which returned for each dimension-value the TOTAL of the expression which you then used as divisor - but this could be quite complicated and will be rather slow especially by larger datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this won't needed to be absolutely flexible of any selections it could be better to calculate these cluster within the script - similar to the suggestion from &lt;A href="https://community.qlik.com/qlik-users/220568"&gt;anagharao&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2016 13:37:19 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-05-12T13:37:19Z</dc:date>
    <item>
      <title>Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127466#M370988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everybody,&lt;/P&gt;&lt;P&gt;I have the following dataset:&lt;/P&gt;&lt;P&gt;SalesOrder&lt;/P&gt;&lt;P&gt;CustomerID&lt;/P&gt;&lt;P&gt;NetPrice&lt;/P&gt;&lt;P&gt;Discount&lt;/P&gt;&lt;P&gt;PriceList&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have first to aggregate:&lt;/P&gt;&lt;P&gt;- NetPrice at Customer level&lt;/P&gt;&lt;P&gt;- Discount at Customer Level&lt;/P&gt;&lt;P&gt;- PriceList at Customer Level&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then define NetPrice Ranges , e.g. 2 ranges A and B:&lt;/P&gt;&lt;P&gt;A = NetPrice @ Customer Level &amp;lt;= 1000&lt;/P&gt;&lt;P&gt;B = NetPrice @ Customer Level &amp;gt; 1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then define Discount Ranges , e.g. 3 ranges D1 D2 D3 as follows:&lt;/P&gt;&lt;P&gt;D1 = Discount @ Customer Level / PriceList @ CUstomer Level &amp;lt;= 10%&lt;/P&gt;&lt;P&gt;D2 = Discount @ Customer Level / PriceList @ CUstomer Level &amp;lt;= 30%&lt;/P&gt;&lt;P&gt;D3 = Discount @ Customer Level / PriceList @ CUstomer Level &amp;gt; 30%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end I need to count distinct Customer for each NetPriceRanges and Discount Ranges&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Emanuele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 21:04:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127466#M370988</guid>
      <dc:creator />
      <dc:date>2016-05-11T21:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127467#M370989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to provide a sample to look at?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-2380"&gt;QlikCommunity Tip: How to get answers to your post?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-1290"&gt;Preparing examples for Upload - Reduction and Data Scrambling&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-16454"&gt;Uploading a Sample&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 02:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127467#M370989</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-12T02:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127468#M370990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the NetPrice ranges you could do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(aggr(sum(NetPrice), CustomerID)&amp;lt;=1000, 'A', 'B')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or maybe in another clustered way with a variable cluster-size:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class(aggr(sum(NetPrice), CustomerID), $(vClusterSize))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The discount ranges could be calculated in a similar way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(aggr(sum(Discount)/sum(PriceList), CustomerID)&amp;lt;=0.1, 'D1',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(aggr(sum(Discount)/sum(PriceList), CustomerID)&amp;lt;=0.3,'D2', 'D3'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very probably you will need further dimensions within the aggr-part, for example Month and Year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 05:32:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127468#M370990</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-12T05:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127469#M370991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try below expressions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Count of Net Price Range A&lt;/P&gt;&lt;P&gt;= Count({&amp;lt;CustId ={"=sum(NetPrice)&amp;lt;=1000"}&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;CustId &lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2) Count of Net Price Range B&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;= Count({&amp;lt;CustId ={"=sum(NetPrice)&amp;gt;1000"}&amp;gt;} &lt;SPAN style="font-size: 13.3333px;"&gt;CustId &lt;/SPAN&gt;)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;3) Discount Range D1&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;= Count({&amp;lt;CustId ={"=sum(&lt;SPAN style="font-size: 13.3333px;"&gt;Discount&lt;/SPAN&gt;)/Sum(Pricelist)&amp;lt;=0.1"}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;CustId &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;4) Discount Range D2&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;= Count({&amp;lt;CustId ={"=sum(&lt;SPAN style="font-size: 13.3333px;"&gt;Discount&lt;/SPAN&gt;)/Sum(Pricelist)&amp;lt;=0.3"}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;CustId &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;5) Discount Range D3&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt; &lt;SPAN style="font-size: 13.3333px;"&gt;= Count({&amp;lt;CustId ={"=sum(&lt;SPAN style="font-size: 13.3333px;"&gt;Discount&lt;/SPAN&gt;)/Sum(Pricelist)&amp;gt;0.3"}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;CustId &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;You can add the the Dimensions you need&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 05:53:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127469#M370991</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-05-12T05:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127470#M370992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, hope the attached helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 07:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127470#M370992</guid>
      <dc:creator>anagharao</dc:creator>
      <dc:date>2016-05-12T07:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127471#M370993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks it works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 07:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127471#M370993</guid>
      <dc:creator />
      <dc:date>2016-05-12T07:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127472#M370994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="doc1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/124392_doc1.jpg" style="width: 620px; height: 338px;" /&gt;&lt;/P&gt;&lt;P&gt;I get this kind of result. Now I need to express in termf of % on total disctinct customer at Net Price Range Level.&lt;/P&gt;&lt;P&gt;For instance the NetPriceRange&amp;nbsp; (B) and Disc Range (B) -&amp;gt; 2526 as 2526/4916 (where 4916 is the Total distinct customer for the NetPrice range B. I tried with Total Qualifier but I do not know how to indicate the calculated dimension "Net Price Range"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Emanuele&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 08:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127472#M370994</guid>
      <dc:creator />
      <dc:date>2016-05-12T08:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated DImension IF Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127473#M370995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A global TOTAL will work but if you need a TOTAL on a certain dimension-level you couldn't do it with a calculated dimension. In this case you need to use an adjusted version of the expression from the calculated dimension which returned for each dimension-value the TOTAL of the expression which you then used as divisor - but this could be quite complicated and will be rather slow especially by larger datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this won't needed to be absolutely flexible of any selections it could be better to calculate these cluster within the script - similar to the suggestion from &lt;A href="https://community.qlik.com/qlik-users/220568"&gt;anagharao&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 13:37:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-DImension-IF-Sum/m-p/1127473#M370995</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-12T13:37:19Z</dc:date>
    </item>
  </channel>
</rss>

