<?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 Aggregation function for Last Year values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregation-function-for-Last-Year-values/m-p/515043#M1141501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;I am currently having a problem trying to get my statement for Last Year values to work. I want to obtain the Cost Value for my Last Year data. It works just fine with this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sum(FOODCOST*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}QUANTITY))&lt;/P&gt;&lt;P&gt;+ Sum(ComboFC*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}ComboQty)))/1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I adopt it to a pivot table and use it for other fields like % to Sales, I realized I had to have an aggregated function for the groupings. So I came up with this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sum(aggr(FOODCOST*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}QUANTITY), PRODUCTDESC, BRANCHNAME, COST1))&lt;/P&gt;&lt;P&gt;+ Sum(aggr(ComboFC*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}ComboQty), COMBOPRODDESC, BRANCHNAME, COST1)))/1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Where COST1 is my Inline Table for Dimensions of the pivot table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the resulting value is lacking by at least 2000 (in P(000)) from my target result. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2013 09:04:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-12T09:04:24Z</dc:date>
    <item>
      <title>Aggregation function for Last Year values</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregation-function-for-Last-Year-values/m-p/515043#M1141501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;I am currently having a problem trying to get my statement for Last Year values to work. I want to obtain the Cost Value for my Last Year data. It works just fine with this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sum(FOODCOST*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}QUANTITY))&lt;/P&gt;&lt;P&gt;+ Sum(ComboFC*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}ComboQty)))/1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I adopt it to a pivot table and use it for other fields like % to Sales, I realized I had to have an aggregated function for the groupings. So I came up with this equation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Sum(aggr(FOODCOST*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}QUANTITY), PRODUCTDESC, BRANCHNAME, COST1))&lt;/P&gt;&lt;P&gt;+ Sum(aggr(ComboFC*Sum({&amp;lt;CalendarYear = {$(=Max(CalendarYear)-1)}&amp;gt;}ComboQty), COMBOPRODDESC, BRANCHNAME, COST1)))/1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Where COST1 is my Inline Table for Dimensions of the pivot table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the resulting value is lacking by at least 2000 (in P(000)) from my target result. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 09:04:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregation-function-for-Last-Year-values/m-p/515043#M1141501</guid>
      <dc:creator />
      <dc:date>2013-09-12T09:04:24Z</dc:date>
    </item>
  </channel>
</rss>

