<?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 Partial sums, unexpectd result in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618797#M227996</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;&lt;/P&gt;&lt;P&gt;I'm trying to add up a set of monetary figures in a pivot table. The income comes in in several different currencys. Depending on what currency the product is bought in, It'l then convert it to sterling pounds. From this point, im trying to add up the new sterling amounts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of sliders which can alter the variables for the currency conversions which the user can set within the app. So it can be altered to the changing currency rates, so this isn't done via script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pivot table itself is quite simple with dimension of&lt;/P&gt;&lt;P&gt;MemberType&lt;/P&gt;&lt;P&gt;MbrSub_Price&lt;/P&gt;&lt;P&gt;month&lt;/P&gt;&lt;P&gt;year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the expression is as follows:- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(MbrSub_CurrencyId =&amp;nbsp; 1 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(HKDollar))/MbrSub_Duration) , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 2 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(USDollar))/MbrSub_Duration),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 3 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(NNaire))/MbrSub_Duration) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 4 , sum((MbrSub_Price / $(CYuan))/MbrSub_Duration) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 5 ,&amp;nbsp; sum((MbrSub_Price / $(NZDollar))/MbrSub_Duration),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 7 ,&amp;nbsp; sum((MbrSub_Price / $(Euro))/MbrSub_Duration) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 8 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(IRupee))/MbrSub_Duration),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum( MbrSub_Price/&amp;nbsp; MbrSub_Duration))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each line that is produced is working fine and calculating correctly ,&lt;/P&gt;&lt;P&gt;totals are calculated by using partial sums on the product - but these are incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list box with all the different currencys in it, if one of these are selected the totals work fine however, if i deselect or select 2 currencys then the partial sums total is equal to the original calc totals without any conversion&lt;/P&gt;&lt;P&gt;i.e. &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;sum( MbrSub_Price/&amp;nbsp; MbrSub_Duration)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;due to the nature of the sheet, im sorry but i cant add the actual file but ive done a mock up &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I just want it to add up whatever it sees in the column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so if you look at the 2 columns original and converted , original calculates correctly but converted doesn't&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2014 10:51:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-25T10:51:00Z</dc:date>
    <item>
      <title>Partial sums, unexpectd result</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618797#M227996</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;&lt;/P&gt;&lt;P&gt;I'm trying to add up a set of monetary figures in a pivot table. The income comes in in several different currencys. Depending on what currency the product is bought in, It'l then convert it to sterling pounds. From this point, im trying to add up the new sterling amounts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of sliders which can alter the variables for the currency conversions which the user can set within the app. So it can be altered to the changing currency rates, so this isn't done via script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pivot table itself is quite simple with dimension of&lt;/P&gt;&lt;P&gt;MemberType&lt;/P&gt;&lt;P&gt;MbrSub_Price&lt;/P&gt;&lt;P&gt;month&lt;/P&gt;&lt;P&gt;year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the expression is as follows:- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(MbrSub_CurrencyId =&amp;nbsp; 1 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(HKDollar))/MbrSub_Duration) , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 2 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(USDollar))/MbrSub_Duration),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 3 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(NNaire))/MbrSub_Duration) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 4 , sum((MbrSub_Price / $(CYuan))/MbrSub_Duration) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 5 ,&amp;nbsp; sum((MbrSub_Price / $(NZDollar))/MbrSub_Duration),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 7 ,&amp;nbsp; sum((MbrSub_Price / $(Euro))/MbrSub_Duration) ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(MbrSub_CurrencyId =&amp;nbsp; 8 ,&amp;nbsp;&amp;nbsp; sum((MbrSub_Price / $(IRupee))/MbrSub_Duration),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum( MbrSub_Price/&amp;nbsp; MbrSub_Duration))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each line that is produced is working fine and calculating correctly ,&lt;/P&gt;&lt;P&gt;totals are calculated by using partial sums on the product - but these are incorrect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list box with all the different currencys in it, if one of these are selected the totals work fine however, if i deselect or select 2 currencys then the partial sums total is equal to the original calc totals without any conversion&lt;/P&gt;&lt;P&gt;i.e. &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt;sum( MbrSub_Price/&amp;nbsp; MbrSub_Duration)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;due to the nature of the sheet, im sorry but i cant add the actual file but ive done a mock up &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I just want it to add up whatever it sees in the column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so if you look at the 2 columns original and converted , original calculates correctly but converted doesn't&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 10:51:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618797#M227996</guid>
      <dc:creator />
      <dc:date>2014-03-25T10:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Partial sums, unexpectd result</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618798#M227997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi attach is an example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to use aggr function , that creates an array of values for each row and summarize them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your function doesn't work because in the total row you have all currencies &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 11:26:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618798#M227997</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2014-03-25T11:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Partial sums, unexpectd result</title>
      <link>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618799#M227998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 11:52:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Partial-sums-unexpectd-result/m-p/618799#M227998</guid>
      <dc:creator />
      <dc:date>2014-03-25T11:52:54Z</dc:date>
    </item>
  </channel>
</rss>

