<?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 Aggr or Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145542#M24234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a difference between Sum(If( condition, X,Y)) and If(Condition,Sum(X),Sum(Y)).&lt;/P&gt;&lt;P&gt;The soulution I suggested works fine, and it adds only one row for each day, any specific reason why you don't want to add that bit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will check what other options could we use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jun 2009 16:30:16 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-06-02T16:30:16Z</dc:date>
    <item>
      <title>Aggr or Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145538#M24230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm trying to do a calculation in an expression in order to aggregrate some cash details in the same currency.&lt;/P&gt;&lt;P&gt;You'll find enclosed an example of what i'm trying to do:&lt;/P&gt;&lt;P&gt;I have some data for different account and in different currency. I'm trying to aggregate those data in a single currency which can be chosen by the user. I don't want to make this calculation during the load because in a shortterm view i will need to get the more flexibility as possible in order to make some comparison, variation, ...&lt;/P&gt;&lt;P&gt;So i really need to do this in an expression and not in the load.&lt;/P&gt;&lt;P&gt;I try do do it using either set analysis or the Aggr function but as i'm new with qlikview i didn't succeed.&lt;/P&gt;&lt;P&gt;Can someone help me please.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 17:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145538#M24230</guid>
      <dc:creator />
      <dc:date>2009-06-01T17:02:54Z</dc:date>
    </item>
    <item>
      <title>Aggr or Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145539#M24231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression i'll try to use is something like :&lt;/P&gt;&lt;P&gt;=sum(PNL*if(CURRENCY=ToCur,1,sum({&amp;lt;FxDate=DATE, FromCur=CURRENCY&amp;gt;} FX)&lt;/P&gt;&lt;P&gt;but still have an error in it.&lt;/P&gt;&lt;P&gt;thks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 17:05:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145539#M24231</guid>
      <dc:creator />
      <dc:date>2009-06-01T17:05:34Z</dc:date>
    </item>
    <item>
      <title>Aggr or Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145540#M24232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I see the problem. It is due to the way If Conditions are evaluated. If the fields are from two different tables, there is a join made before doing the evaluation, so a simple if statement returns you a multiple of the value expected in some conditions.&lt;/P&gt;&lt;P&gt;If We put the following expression :&lt;/P&gt;&lt;P&gt;Sum(If(CURRENCY=FromCur and DATE=FxDate,FX*PNL)&lt;/P&gt;&lt;P&gt;it works fine for all the currencies where CURRENCY&amp;lt;&amp;gt;ToCur.&lt;/P&gt;&lt;P&gt;If you now add the condition for ToCur;&lt;/P&gt;&lt;P&gt;Sum(If(CURRENCY=ToCur, PNL,&lt;/P&gt;&lt;P&gt;If(CURRENCY=FromCur and DATE=FxDate,FX*PNL))&lt;/P&gt;&lt;P&gt;It doesn't work as for the entries where CURRENCY=ToCur, you get multiple values.&lt;/P&gt;&lt;P&gt;There is a simple way to resolve this by adding a ToCur and FromCur value for same date with FX=1 for each currency.&lt;/P&gt;&lt;P&gt;Concatenate FXTable&lt;/P&gt;&lt;P&gt;Load Distinct FxDate,ToCur as FromCur, ToCur,1 as FX&lt;/P&gt;&lt;P&gt;Resident FXTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There might be other clever options to do this, but this one should work while keeping the expression simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 20:36:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145540#M24232</guid>
      <dc:creator />
      <dc:date>2009-06-01T20:36:36Z</dc:date>
    </item>
    <item>
      <title>Aggr or Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145541#M24233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try this :&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;if(CURRENCY=ToCur, &lt;P&gt;sum(PNL),&lt;/P&gt;&lt;P&gt;if(ACCOUNT='C1' or ACCOUNT='C2',&lt;/P&gt;&lt;P&gt;sum(if(CURRENCY=FromCur and xDate=DATE,YTDFX*PNL)),&lt;/P&gt;&lt;P&gt;sum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;(if(CURRENCY=FromCur and FxDate=DATE,FX*PNL))) &lt;P&gt;)&lt;/P&gt;&lt;P&gt;This expression give me the good value but when i had partial sum, all value corresponding to CURRENCY=ToCur are ignored !!!&lt;/P&gt;&lt;P&gt;Regarding the number of values i can get (nb of day,...), i don't want to duplicate each currency ,e.g. USD USD 1.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2009 21:33:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145541#M24233</guid>
      <dc:creator />
      <dc:date>2009-06-01T21:33:13Z</dc:date>
    </item>
    <item>
      <title>Aggr or Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145542#M24234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a difference between Sum(If( condition, X,Y)) and If(Condition,Sum(X),Sum(Y)).&lt;/P&gt;&lt;P&gt;The soulution I suggested works fine, and it adds only one row for each day, any specific reason why you don't want to add that bit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will check what other options could we use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2009 16:30:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145542#M24234</guid>
      <dc:creator />
      <dc:date>2009-06-02T16:30:16Z</dc:date>
    </item>
    <item>
      <title>Aggr or Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145543#M24235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't read carefully, so apologies if I'm off base, but here's an example of currency conversion on the fly based on rates updated monthly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 01:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-or-Set-Analysis/m-p/145543#M24235</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-06-03T01:26:24Z</dc:date>
    </item>
  </channel>
</rss>

