<?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 Calculating aggregate sales for 2 different periods using this formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-aggregate-sales-for-2-different-periods-using-this/m-p/515227#M192394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to calculate Aggregate Sales for 2 different time periods using the below formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New';"&gt;Power((V(tn)/V(to)),1/(tn-to)) - 1&lt;BR /&gt;&lt;BR /&gt;Where &lt;BR /&gt;&lt;BR /&gt;V(tn) = Aggregate Primary Sales Quantity for last period of selection&lt;BR /&gt;V(to) = Aggregate Primary Sales Quantity for first period of selection&lt;BR /&gt;&lt;BR /&gt;tn-to = Number of periods(For eg.if I have selected 2012 Q2 and 2013 Q3,so tn-t0 will be 5)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Here tn &amp;amp; t0 can be Year,Quarter and Month&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;I have written the below Expression but it is not working correctly :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New';"&gt;=if(GetSelectedCount(Year)&amp;gt;0,&amp;nbsp; &lt;BR /&gt;(pow(sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty)/sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Min(Year))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty),1/((max(Year)-min(Year))))-1),&lt;BR /&gt;if(GetSelectedCount(Quarter)&amp;gt;0,&lt;BR /&gt;(pow(sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Max(Quarter))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty)/sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Min(Quarter))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty),(1/(max({&amp;lt;Year={$(=Max(Year))}&amp;gt;} Quarter)-min({&amp;lt;Year={$(=Max(Year))}&amp;gt;}&lt;BR /&gt;Quarter))))-1),&lt;BR /&gt; if(GetSelectedCount(Month)&amp;gt;0,&lt;BR /&gt;(pow(sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Max(Quarter))},Month={$(=Max(Month))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty)/sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Min(Quarter))},Month={$(=Min(Month))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty),1/(max({&amp;lt;Year={$(=Max(Year))}&amp;gt;}&lt;BR /&gt;Month)-min({&amp;lt;Year={$(=Max(Year))}&amp;gt;} Month))))-1)))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;can anyone please help me out on the above query.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;hari&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Nov 2013 09:19:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-13T09:19:42Z</dc:date>
    <item>
      <title>Calculating aggregate sales for 2 different periods using this formula</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-aggregate-sales-for-2-different-periods-using-this/m-p/515227#M192394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to calculate Aggregate Sales for 2 different time periods using the below formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New';"&gt;Power((V(tn)/V(to)),1/(tn-to)) - 1&lt;BR /&gt;&lt;BR /&gt;Where &lt;BR /&gt;&lt;BR /&gt;V(tn) = Aggregate Primary Sales Quantity for last period of selection&lt;BR /&gt;V(to) = Aggregate Primary Sales Quantity for first period of selection&lt;BR /&gt;&lt;BR /&gt;tn-to = Number of periods(For eg.if I have selected 2012 Q2 and 2013 Q3,so tn-t0 will be 5)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Here tn &amp;amp; t0 can be Year,Quarter and Month&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;I have written the below Expression but it is not working correctly :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New';"&gt;=if(GetSelectedCount(Year)&amp;gt;0,&amp;nbsp; &lt;BR /&gt;(pow(sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty)/sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Min(Year))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty),1/((max(Year)-min(Year))))-1),&lt;BR /&gt;if(GetSelectedCount(Quarter)&amp;gt;0,&lt;BR /&gt;(pow(sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Max(Quarter))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty)/sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Min(Quarter))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty),(1/(max({&amp;lt;Year={$(=Max(Year))}&amp;gt;} Quarter)-min({&amp;lt;Year={$(=Max(Year))}&amp;gt;}&lt;BR /&gt;Quarter))))-1),&lt;BR /&gt; if(GetSelectedCount(Month)&amp;gt;0,&lt;BR /&gt;(pow(sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Max(Quarter))},Month={$(=Max(Month))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty)/sum({&amp;lt;Origin={'PRIMARYSALES'},Year={$(=Max(Year))},Quarter={$(=Min(Quarter))},Month={$(=Min(Month))}&amp;gt;}&lt;BR /&gt;Sales_Plan_Qty),1/(max({&amp;lt;Year={$(=Max(Year))}&amp;gt;}&lt;BR /&gt;Month)-min({&amp;lt;Year={$(=Max(Year))}&amp;gt;} Month))))-1)))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;can anyone please help me out on the above query.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;hari&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 09:19:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-aggregate-sales-for-2-different-periods-using-this/m-p/515227#M192394</guid>
      <dc:creator />
      <dc:date>2013-11-13T09:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating aggregate sales for 2 different periods using this formula</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-aggregate-sales-for-2-different-periods-using-this/m-p/515228#M192395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; First, this forum is about Expressor so I suggest you to move the question to another QlikView forum to be watched by more people.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Anyway, without seen the model and the data you are using it is very difficult to give a response. I suggest to attach an example application with scrambled/fake data to the question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 10:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-aggregate-sales-for-2-different-periods-using-this/m-p/515228#M192395</guid>
      <dc:creator />
      <dc:date>2013-11-13T10:19:01Z</dc:date>
    </item>
  </channel>
</rss>

