<?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: Help with aggregating an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36964#M776184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry! it should be this..&lt;/P&gt;&lt;P&gt;689,053.47&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 May 2018 12:21:41 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2018-05-01T12:21:41Z</dc:date>
    <item>
      <title>Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36958#M776178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;I have the following expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(aggr($(vAnnualSalesv2),SubCat,SubCat1,[Item Description]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is made up of the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$(vAvgPrice)*$(vForecastSales)+$(vTotalSalestoLastPeriod)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought it was working but noticed that the results were lower than expected. On investigation i found that some rows of data were not being included because they didn't have a 'ForecastSales' value (as they have been discontinued). &lt;/P&gt;&lt;P&gt;i have therefore changed the expression to the following..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(isnull($(vForecastSales)),$(vTotalSalestoLastPeriod),sum(aggr($(vAnnualSales),SubCat,SubCat1,[Item Description])))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this populates a straight table correctly when i am drilling down to 'Product' level, but it doesnt aggregate properley when going back up the drill down. &lt;/P&gt;&lt;P&gt;as you can see, the total for the 3 lines add correctly..&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/201112_Capture.PNG" style="height: 120px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when going back up yoiu can see that it shows a different value (highlighted - its missing the 7,102.08)&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/201116_Capture.PNG" style="height: 154px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone see what i am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks, example attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36958#M776178</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36959#M776179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone help with this? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 07:34:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36959#M776179</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-05-01T07:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36960#M776180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure that they drilled down version is the right number? I used this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum(aggr(if(isnull($(vForecastSales)),$(vTotalSalestoLastPeriod),$(vAnnualSales)),SubCat,SubCat1,[Item Description]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not drilled down version looks almost the same, except one change...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201157_Capture.PNG" style="height: 281px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But drilled down now matches with non drilled down version&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/201167_Capture.PNG" style="height: 288px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 09:17:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36960#M776180</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-01T09:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36961#M776181</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 reply.&lt;/P&gt;&lt;P&gt;What i need is when drilled down, the top line should display 7102.08, which then changes the total to 134,248.32.&lt;/P&gt;&lt;P&gt;Then going back up a level i should see that total value for that particular subcat1 (Kbd Pxafxq: Uiibdl AT/Pzagix) is showing 681,308.43. &lt;/P&gt;&lt;P&gt;then obviously going up a higher level would also aggregate correctly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does that make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 11:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36961#M776181</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-05-01T11:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36962#M776182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you come up with this number?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;681,308.43&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:11:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36962#M776182</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-01T12:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36963#M776183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Period&amp;gt;}Aggr(If(IsNull($(vForecastSales)), $(vTotalSalestoLastPeriod), $(vAnnualSales)), SubCat, SubCat1, [Item Description]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201172_Capture.PNG" style="height: 176px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36963#M776183</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-01T12:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36964#M776184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry! it should be this..&lt;/P&gt;&lt;P&gt;689,053.47&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:21:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36964#M776184</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-05-01T12:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36965#M776185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think thats it! it looks like one of the others was also wrong which is now correct too. &lt;/P&gt;&lt;P&gt;Thanks Sunny, i will put this into my live doc and see what happens &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:23:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36965#M776185</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-05-01T12:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36966#M776186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like a plan &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;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:24:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36966#M776186</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-01T12:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36967#M776187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK that seems to work for that expression, are you able to help with getting the same thing to work on some other expressions? &lt;/P&gt;&lt;P&gt;I am just about to create a new discussion..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36967#M776187</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2018-05-01T12:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with aggregating an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36968#M776188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 13:04:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-aggregating-an-expression/m-p/36968#M776188</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-05-01T13:04:36Z</dc:date>
    </item>
  </channel>
</rss>

