<?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 How to calculate Average figures? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312371#M115354</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 have the following table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * Inline&lt;BR /&gt;[&lt;BR /&gt;Region, ExchangeRate,LocalAmount&lt;BR /&gt;US, 1&lt;BR /&gt;Brazil,1.7&lt;BR /&gt;US,,100&lt;BR /&gt;Brazil,,100&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I concatenate the ExchangeRate and LocalAmount into one table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then ExchangeRate is based on USD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to show the total USD Amount in one pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I use this expression sum(LocalAmount)/Avg(ExchangeRate), but it show the wrong numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I choose one region US or Brazil, the number is right, so how to calculate this total USD number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the QVW doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Nov 2011 05:38:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-11T05:38:28Z</dc:date>
    <item>
      <title>How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312371#M115354</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 have the following table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * Inline&lt;BR /&gt;[&lt;BR /&gt;Region, ExchangeRate,LocalAmount&lt;BR /&gt;US, 1&lt;BR /&gt;Brazil,1.7&lt;BR /&gt;US,,100&lt;BR /&gt;Brazil,,100&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I concatenate the ExchangeRate and LocalAmount into one table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then ExchangeRate is based on USD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to show the total USD Amount in one pivot table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I use this expression sum(LocalAmount)/Avg(ExchangeRate), but it show the wrong numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I choose one region US or Brazil, the number is right, so how to calculate this total USD number?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the QVW doc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 05:38:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312371#M115354</guid>
      <dc:creator />
      <dc:date>2011-11-11T05:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312372#M115355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I might be misunderstanding here (specially the average portion). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what I understood you have following need:&lt;/P&gt;&lt;P&gt;1. You have atleast two regions i.e. US and Brazil&lt;/P&gt;&lt;P&gt;2. You have the exchange rate. (1 for US and 1.7 for Brazil)&lt;/P&gt;&lt;P&gt;3. You have amount in local currency that was earned (since it is +ve) for the region.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4. Now you need to get the amount for the region in US dollars. (LocalAmount/ExchangeRate)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Try with straight table first:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Create a straight table.&lt;/P&gt;&lt;P&gt;2. Set dimension as Region. &lt;/P&gt;&lt;P&gt;3. Expression 1 = Sum(ExchangeRate), Expression 2 = Sum(LocalAmount), Expression 3 = column(2) /column(1), Expression 4 = Sum(LocalAmount) / Sum(ExchangeRate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For Pivot:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Create the pivot chart.&lt;/P&gt;&lt;P&gt;2. Dimension is Region.&lt;/P&gt;&lt;P&gt;3. Expression is Sum(LocalAmount) / Sum(ExchangeRate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I dont understand is the reason for average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 06:17:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312372#M115355</guid>
      <dc:creator />
      <dc:date>2011-11-11T06:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312373#M115356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply, why I use average exchangeRate, because there are lot of ExchangeRate based on day, I just &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List one exchage rate record for each country.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 06:21:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312373#M115356</guid>
      <dc:creator />
      <dc:date>2011-11-11T06:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312374#M115357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another thing is: Even if I use your expression: &lt;/P&gt;&lt;P&gt;Sum(LocalAmount) / Sum(ExchangeRate), the result is also wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you choose Region BR and US together: the figure is: 74, the right number is: 158&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to figure it out? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 06:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312374#M115357</guid>
      <dc:creator />
      <dc:date>2011-11-11T06:23:30Z</dc:date>
    </item>
    <item>
      <title>How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312375#M115358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shows me right in my straight table. Also in the expressions tab i had to change the Total mode to Sum of Rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also can u set dimension as region in your chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I am still misunderstanding can u post the latest file again?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 06:40:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312375#M115358</guid>
      <dc:creator />
      <dc:date>2011-11-11T06:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312376#M115359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can not add Region dimension, I just want to show the total USD amount in Pivot table not straight table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 06:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312376#M115359</guid>
      <dc:creator />
      <dc:date>2011-11-11T06:45:03Z</dc:date>
    </item>
    <item>
      <title>How to calculate Average figures?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312377#M115360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here you go: sum(aggr(Sum(LocalAmount)/Avg(ExchangeRate),Region))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your original file the calc that was being done was 200 / ((1+1.7)/2) = 148.148. What is actually needed is (100/1) + (100/1.7) = 158.82. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps. Let me know if it does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Nov 2011 06:53:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-Average-figures/m-p/312377#M115360</guid>
      <dc:creator />
      <dc:date>2011-11-11T06:53:31Z</dc:date>
    </item>
  </channel>
</rss>

