<?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 Help on correct calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464571#M488863</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having some problems either in my calculation or my datamodel. I have no idea where I made my mistake.&lt;/P&gt;&lt;P&gt;In the attached example I've put in one line to demonstrate my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a product which has a start and end date. The salesprice of this product was 60000 when sold. Every product has a 60months lifetime cycle. That means that for 60 months long each month this product has a value of 1000. But when I let my table make the subtotal, than it will say 1000 while it should be 12000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table is displaying everything correct. But it seems that it just doesn't want to make the correct calculation in my subtotals. Can anyone help me out with this one? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 Nov 2012 20:39:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-11-25T20:39:32Z</dc:date>
    <item>
      <title>Help on correct calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464571#M488863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having some problems either in my calculation or my datamodel. I have no idea where I made my mistake.&lt;/P&gt;&lt;P&gt;In the attached example I've put in one line to demonstrate my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a product which has a start and end date. The salesprice of this product was 60000 when sold. Every product has a 60months lifetime cycle. That means that for 60 months long each month this product has a value of 1000. But when I let my table make the subtotal, than it will say 1000 while it should be 12000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table is displaying everything correct. But it seems that it just doesn't want to make the correct calculation in my subtotals. Can anyone help me out with this one? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Nov 2012 20:39:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464571#M488863</guid>
      <dc:creator />
      <dc:date>2012-11-25T20:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help on correct calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464572#M488864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The total mode in a pivot table is expression total, you can't set it to sum of rows in expression tab like for a straight table chart. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can reproduce a sum-of-rows using advanced aggregation (i.e. the aggr() function). There is a chapter in the HELP that describes this (sum-of-rows in a pivot using advanced aggregation).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression then looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(aggr(sum(Price)/60,Year,Month,Key))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might also be able to use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=sum(Price/60)*count(distinct Month)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your special case where all lines are the same amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Nov 2012 20:53:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464572#M488864</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-25T20:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help on correct calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464573#M488865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tried it and it worked. Just what I needed. I've been braking my head over this all weekend. &lt;/P&gt;&lt;P&gt;Appreciate the help Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Nov 2012 20:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-on-correct-calculation/m-p/464573#M488865</guid>
      <dc:creator />
      <dc:date>2012-11-25T20:59:37Z</dc:date>
    </item>
  </channel>
</rss>

