<?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 Problem in aggregating data with different currencies in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399605#M563789</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;here is my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 sources (xls files) with the following fields&lt;/P&gt;&lt;P&gt;1st has project_code and activity_revenue;&lt;/P&gt;&lt;P&gt;2nd has project_code, type of work, and currency;&lt;/P&gt;&lt;P&gt;3rd has currency and exchange_rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart which has as dimension "type of work" and as expression "sum(activity_revenue)/exchange_rate" I get the errore "No Data to visualize".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the expression in "sum(activity_revenue/exchange_rate)" data is showed but the values are wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a table with "project_code" as dimension and "sum(activity_revenue)/exchange_rate" as expression, data is showed correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone can figure this out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Feb 2013 13:33:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-04T13:33:12Z</dc:date>
    <item>
      <title>Problem in aggregating data with different currencies</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399605#M563789</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;here is my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 sources (xls files) with the following fields&lt;/P&gt;&lt;P&gt;1st has project_code and activity_revenue;&lt;/P&gt;&lt;P&gt;2nd has project_code, type of work, and currency;&lt;/P&gt;&lt;P&gt;3rd has currency and exchange_rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a chart which has as dimension "type of work" and as expression "sum(activity_revenue)/exchange_rate" I get the errore "No Data to visualize".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the expression in "sum(activity_revenue/exchange_rate)" data is showed but the values are wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a table with "project_code" as dimension and "sum(activity_revenue)/exchange_rate" as expression, data is showed correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone can figure this out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 13:33:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399605#M563789</guid>
      <dc:creator />
      <dc:date>2013-02-04T13:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in aggregating data with different currencies</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399606#M563790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In principle, the "sum(activity_revenue/exchange_rate)" should be the right one. Then QlikView will assign the exchange rate to each activity_revenue &lt;STRONG&gt;&lt;EM&gt;before &lt;/EM&gt;&lt;/STRONG&gt;summing them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression "sum(activity_revenue)/exchange_rate" will work &lt;STRONG&gt;&lt;EM&gt;only&lt;/EM&gt;&lt;/STRONG&gt; if there is just one possible exchange_rate. If there are several, QlikView will evaluate this as "sum(activity_revenue)/Only(exchange_rate)", i.e. the denominator will be NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, your data model only has one key: project_code. So if one project_code has several currencies (e.g. different ones for different types of work) then your data model is insufficient. You need a second key to link activity_revenue and exchange_rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post a file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 15:08:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399606#M563790</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-02-04T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in aggregating data with different currencies</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399607#M563791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Henric,&lt;/P&gt;&lt;P&gt;I tried to apply what you wrote,&lt;/P&gt;&lt;P&gt;the problem is that&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;sum(activity_revenue/exchange_rate)&lt;/SPAN&gt; returns clearly wrong results, and I cant fugure out why (screnshot 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;sum(activity_revenue)/exchange_rate&lt;/SPAN&gt; as you say, works only if one exchange rate only is possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea about how can I handle it?&lt;/P&gt;&lt;P&gt;Maybe with variables?&lt;/P&gt;&lt;P&gt;Because I don't have other keys to add...&lt;IMG __jive_id="33101" class="jive-image-thumbnail jive-image" onclick="" alt="qlv screen 2.png" src="/legacyfs/online/33101_qlv screen 2.png" width="450" /&gt;&lt;IMG __jive_id="33102" class="jive-image-thumbnail jive-image" onclick="" alt="qlv screen.png" src="/legacyfs/online/33102_qlv screen.png" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 12:19:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399607#M563791</guid>
      <dc:creator />
      <dc:date>2013-02-05T12:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in aggregating data with different currencies</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399608#M563792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see what happens now. A single billing code can link several times to the same client_currency so the Sum() function will loop over all combinations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move the exchange rate into the activity table using the following script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ExchangeRates:&lt;/P&gt;&lt;P&gt;Mapping Load distinct client_currency, exchange_rate from [Exchange rates]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currencies:&lt;/P&gt;&lt;P&gt;Mapping Load distinct billing_code, client_currency from [projects]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Projects:&lt;/P&gt;&lt;P&gt;Load * from projects;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Activity:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Applymap('ExchangeRates',Applymap('Currencies',billing_code),null()) as exchange_rate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from activity;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use sum(activity_revenue/exchange_rate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 13:43:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-in-aggregating-data-with-different-currencies/m-p/399608#M563792</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-02-05T13:43:59Z</dc:date>
    </item>
  </channel>
</rss>

