<?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: Calculating with different Currency rates (sum in pivot) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416841#M487066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have the problem with my variable:&lt;/P&gt;&lt;P&gt;when I write&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13626541922182615" jivemacro_uid="_13626541922182615"&gt;&lt;P&gt;=sum(aggr(sum(if(not Wildmatch(Currency,'EUR'), Amount / (1 * ECBrate),Amount)),Currency))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;in my pivot expression, the right sum is calcluated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I need to modify my variable &lt;CODE class="jive-code"&gt;vEurAmount to use the expression you posted:&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13626541922162083" jivemacro_uid="_13626541922162083"&gt;&lt;CODE class="jive-code"&gt;=sum(aggr(sum($(vEurAmount)),Currency))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get blank rows with or without the sum calculation in the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2013 11:02:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-07T11:02:46Z</dc:date>
    <item>
      <title>Calculating with different Currency rates (sum in pivot)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416839#M487064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello comunity,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need help with my currency problem:&lt;/P&gt;&lt;P&gt;I have various currencies and I use a currency/rate table (ECB) to get the right values at the right day.&lt;/P&gt;&lt;P&gt;I now need to multiply my &lt;STRONG&gt;Amount &lt;/STRONG&gt;field which also has a &lt;STRONG&gt;Curreny &lt;/STRONG&gt;field with the right Currency and Date. This all works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I have is that when my currency is EUR I don't have any values in my ECB rate table, so I'll just use this if statement in my vEurAmount variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13626497970953721" jivemacro_uid="_13626497970953721"&gt;&lt;P&gt;if(Currency &amp;lt;&amp;gt;'EUR', sum(Amount / (1 * ECBrate)),sum(Amount))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my straight table I can set the total mode to "Sum of all rows" but I can't use this in my pivot table.&lt;/P&gt;&lt;P&gt;So I tried this expression: &lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1362649805765660" jivemacro_uid="_1362649805765660"&gt;&lt;P&gt;=sum(aggr(sum($(vEurAmount)) &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;which won't return anything. &lt;/P&gt;&lt;P&gt;I've tried other combinations but I can't get the syntax right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you can help me to set up the right expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, is the variable I defined the right way to do this? I've also removed the sum function in the variable but no luck either.&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>Thu, 07 Mar 2013 09:59:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416839#M487064</guid>
      <dc:creator />
      <dc:date>2013-03-07T09:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating with different Currency rates (sum in pivot)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416840#M487065</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;Use Not Wildmatch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;if( not Wildmatch(Currency,'EUR'), sum(Amount / (1 * ECBrate)),sum(Amount))&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use aggr fn then you should mention the field name to do the group by.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;=sum(aggr(sum($(vEurAmount)),FieldName))&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nirav Bhimani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 10:24:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416840#M487065</guid>
      <dc:creator>nirav_bhimani</dc:creator>
      <dc:date>2013-03-07T10:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating with different Currency rates (sum in pivot)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416841#M487066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for the expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still have the problem with my variable:&lt;/P&gt;&lt;P&gt;when I write&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13626541922182615" jivemacro_uid="_13626541922182615"&gt;&lt;P&gt;=sum(aggr(sum(if(not Wildmatch(Currency,'EUR'), Amount / (1 * ECBrate),Amount)),Currency))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;in my pivot expression, the right sum is calcluated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I need to modify my variable &lt;CODE class="jive-code"&gt;vEurAmount to use the expression you posted:&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13626541922162083" jivemacro_uid="_13626541922162083"&gt;&lt;CODE class="jive-code"&gt;=sum(aggr(sum($(vEurAmount)),Currency))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get blank rows with or without the sum calculation in the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 11:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416841#M487066</guid>
      <dc:creator />
      <dc:date>2013-03-07T11:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating with different Currency rates (sum in pivot)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416842#M487067</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;Can you please share your Demo file so that its more clear, Will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nirav Bhimani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 11:51:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416842#M487067</guid>
      <dc:creator>nirav_bhimani</dc:creator>
      <dc:date>2013-03-07T11:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating with different Currency rates (sum in pivot)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416843#M487068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on real data so I can't create a file for it. BTW I changed the Currency field to InvoiceCurrency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try to explain it with this picture:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="34569" class="jive-image-thumbnail jive-image" height="151" onclick="" alt="qlik.png" src="https://community.qlik.com/legacyfs/online/34569_qlik.png" width="620" /&gt;&lt;/P&gt;&lt;P&gt;In the "EUR-Amount" pivot table I placed above expression which delivers the correct result for the total.&lt;/P&gt;&lt;P&gt;But since I need this expression in various ways, I need it in a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the "Point in Time Reporting" for example. The "Sales YTD" doesn't deliver the desired result. But I wasn't able to copy&amp;amp;paste the working expression above to replace the $(vEurAmount) statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I believe the variable expression needs to be changed. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 13:53:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416843#M487068</guid>
      <dc:creator />
      <dc:date>2013-03-07T13:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating with different Currency rates (sum in pivot)</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416844#M487069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since I can't get it to work like that I would like to create a new calculated field in my script for the &lt;STRONG&gt;EUR Amount&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this statement:&lt;/P&gt;&lt;P&gt;if(NOT Wildmatch(InvoiceCurrency,'EUR'), (Amount / (1 * ECBrate)),Amount) AS EUR_Amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should create the new field. Problem I have is that the ECBrate field comes from a different table.&lt;/P&gt;&lt;P&gt;Both tables share a key field "CombCurrDate".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do I need to do to get this calculation running?&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>Mon, 18 Mar 2013 08:17:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-with-different-Currency-rates-sum-in-pivot/m-p/416844#M487069</guid>
      <dc:creator />
      <dc:date>2013-03-18T08:17:09Z</dc:date>
    </item>
  </channel>
</rss>

