<?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: calculation in pivot expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/calculation-in-pivot-expression/m-p/759856#M270361</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there not a problem with Aggr function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&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;=SUM(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333339691162px;"&gt;{&amp;lt;TCMSALESORDERYear={'$(vMaxYearOrder)'},TCMSALESORDERMonth={'$(vMaxMonthOrder)'},TCMSALESORDERDay='&amp;lt;=$(vMaxDayOrder)'},TCMSALESORDERDATE=,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333339691162px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TCMSALESORDERMonthYear=&amp;gt;}&lt;/SPAN&gt;&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;Aggr((FirstSortedValue(COSTPRICE,&lt;/SPAN&gt;&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;-MODIFIEDDATETIME_INVENTTABLEMODUL)*sum(QTYORDERED)),&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;TEXTVALUE,SALESID,ITEMID))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jan 2015 11:41:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-10T11:41:15Z</dc:date>
    <item>
      <title>calculation in pivot expression</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-pivot-expression/m-p/759855#M270360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i have a pivot table with three dimensions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;textvalue, salesis, itemid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first expression is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value for cumulative year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;TCMSALESORDERYear={'$(vMaxYearOrder)'},TCMSALESORDERDATE={'&amp;lt;=$(vMaxDateOrder)'},TCMSALESORDERMonth=,TCMSALESORDERDay=,TCMSALESORDERMonthYear=&amp;gt;} QTYORDERED)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the second expression is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the costprice for cumulative year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;TCMSALESORDERYear={'$(vMaxYearOrder)'},TCMSALESORDERDATE={'&amp;lt;=$(vMaxDateOrder)'},TCMSALESORDERMonth=,TCMSALESORDERDay=,TCMSALESORDERMonthYear=&amp;gt;} Aggr((FirstSortedValue(COSTPRICE,-MODIFIEDDATETIME_INVENTTABLEMODUL)*sum(QTYORDERED)), TEXTVALUE,SALESID,ITEMID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is here &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the value for the selected month this expression is right&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;TCMSALESORDERYear={'$(vMaxYearOrder)'},TCMSALESORDERMonth={'$(vMaxMonthOrder)'},TCMSALESORDERDay={'&amp;lt;=$(vMaxDayOrder)'},TCMSALESORDERDATE=,TCMSALESORDERMonthYear=&amp;gt;}QTYORDERED)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but her is the devil inside:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i get in sum the same like zhe second expression above the result is the cumulative value * costprice and not the month value per costprice &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CostPrice per month expression:&lt;/P&gt;&lt;P&gt;sum(aggr(FirstSortedValue(COSTPRICE,-MODIFIEDDATETIME_INVENTTABLEMODUL) * SUM({&amp;lt;TCMSALESORDERYear={'$(vMaxYearOrder)'},TCMSALESORDERMonth={'$(vMaxMonthOrder)'},TCMSALESORDERDay={'&amp;lt;=$(vMaxDayOrder)'},TCMSALESORDERDATE=,TCMSALESORDERMonthYear=&amp;gt;}QTYORDERED),TEXTVALUE, SALESID, ITEMID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 09:40:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-pivot-expression/m-p/759855#M270360</guid>
      <dc:creator />
      <dc:date>2015-01-09T09:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: calculation in pivot expression</title>
      <link>https://community.qlik.com/t5/QlikView/calculation-in-pivot-expression/m-p/759856#M270361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there not a problem with Aggr function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&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;=SUM(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333339691162px;"&gt;{&amp;lt;TCMSALESORDERYear={'$(vMaxYearOrder)'},TCMSALESORDERMonth={'$(vMaxMonthOrder)'},TCMSALESORDERDay='&amp;lt;=$(vMaxDayOrder)'},TCMSALESORDERDATE=,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333339691162px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;TCMSALESORDERMonthYear=&amp;gt;}&lt;/SPAN&gt;&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;Aggr((FirstSortedValue(COSTPRICE,&lt;/SPAN&gt;&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;-MODIFIEDDATETIME_INVENTTABLEMODUL)*sum(QTYORDERED)),&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;TEXTVALUE,SALESID,ITEMID))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 11:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculation-in-pivot-expression/m-p/759856#M270361</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-10T11:41:15Z</dc:date>
    </item>
  </channel>
</rss>

