<?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: Calculate Amounts in Base Currency Using Rate for the End of Period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174329#M502573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amigo John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sou do Brasil, poderia me orientar, tenho uma tabela que necessita ser atualizada todo final de mês, ou seja dia 30 ou 31 de cada mês, esta em excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E o seguinte tenho um valor po exemplo de&amp;nbsp;&amp;nbsp;&amp;nbsp; R$200,00&amp;nbsp; desde do ano de 2000, necessito atuliazado ela taxa selic acumulado todo final de mês.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inicial&amp;nbsp; 01/02/2000 -&amp;nbsp; data final&amp;nbsp; - 31/03/2015, este mesmo processo e feito para valores do ano 2001,2002 e 2003, sendo valores diferentes.&lt;/P&gt;&lt;P&gt;Poderia me ajuda a contruir um qvw, onde possa atualizar este valore automaticamente.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agradeço seu auxilio desde já&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2015 14:09:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-29T14:09:41Z</dc:date>
    <item>
      <title>Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174323#M502562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I need a special way to calculate amounts in base currency using exchange rates. User can choose a period to analyse Accounts Receivable historical status (Difference between Invoiced amount and received cash). Amounts could be in different currencies. For summary all amount has to be in base currency - USD. There is no problem to calculate USD amount using each transaction date exchange rate (by linking exchange rates through date and currency). But in my case all amounts has to be recalculated to USD using period last date exchange rate.&lt;/P&gt;&lt;P&gt;E.g. user analyses week 17. It ends on 2nd of May year 2010 (2010.05.02). So expressions have to divide amounts in transaction currencies by exchange rates for 2nd of May.&lt;/P&gt;&lt;P&gt;In my case it looks like two Set Analysis statements one within another. But I have no idea how to reach it.&lt;/P&gt;&lt;P&gt;I think, that an independent exchange rates table is needed, so I created it in attached file.&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;Rgds,&lt;BR /&gt;AT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Aug 2010 12:50:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174323#M502562</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-25T12:50:30Z</dc:date>
    </item>
    <item>
      <title>Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174324#M502563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, Artjoms.&lt;/P&gt;&lt;P&gt;I don't sure that your task can be resolve only by Set Analysis. So I created some changes in your script and then created a small chart. I use only one Key figures (Receipts Amount). I think you can understand my idea and create other expressions...&lt;/P&gt;&lt;P&gt;see in my example (sheet 2 - RESULT table)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 11:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174324#M502563</guid>
      <dc:creator>sparur</dc:creator>
      <dc:date>2010-08-26T11:03:52Z</dc:date>
    </item>
    <item>
      <title>Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174325#M502564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool solution!&lt;/P&gt;&lt;P&gt;But in this case user can select only whole week period. Selected period can be a month, a week, a year or even a difference between two dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 12:08:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174325#M502564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-26T12:08:36Z</dc:date>
    </item>
    <item>
      <title>Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174326#M502566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was unable to solve your problem, but I did notice a few things that I'd like to point out, in case it helps.&lt;/P&gt;&lt;P&gt;First, your variable, vCurrRateDate, is a date. In your data set, your dates are numbers. In order to use that variable, you want it to be a number, not a date. I made a new variable, vCurrRateNum, with the expression:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=if(max(Cal.Date)&amp;gt;max(total Date),max(total Date),max(Cal.Date))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Then, you are using Only in your denominator when trying to get the currency for each Office/Customer. That isn't working, because the dollar sign expansion is evaluated for the entire chart, not record by record. If you put just the denominator into an expression, you will notice that it returns null for everyone. I believe the only way to handle this portion is to use an if, which is evaluated separately for each record. Here is an expression that I believe gives you the exchange rate to use for each record:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Max({&amp;lt;CurrRates2.Date={"$(#vCurrRateNum)"}&amp;gt;}&lt;BR /&gt; If(CurrRates2.Trans.curr = Trans.curr, [CurrRates2.Curr rate]))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;If you put that into an expression by itself, you will get an exchange rate returned, you should verify if it is the correct exhchange rate. &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Finally, you can't use a Max (or Only, I believe) inside of another Sum. In order to use nested aggregates, you must use the Aggr function. Here is the correct format, but I don't believe that is giving you the intended answer:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=sum({&amp;lt;Date = {"&amp;lt;=$(=max([Cal.Date]))"}&amp;gt;} [Amount curr Rec]/&lt;BR /&gt; Aggr(&lt;BR /&gt; Max({&amp;lt;CurrRates2.Date={"$(#vCurrRateNum)"}&amp;gt;}&lt;BR /&gt; If(CurrRates2.Trans.curr = Trans.curr, [CurrRates2.Curr rate]))&lt;BR /&gt; , Office, Customer))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Looking at your expression, I think you want to Sum up all of the Rec or Paym values and then divide by the exchange rate. Is there any reason to divide each individual record by the exchange rate? If you sum, then divide, you can get rid of the Aggr. I'm still not sure if this is the result you were looking for, but it looks reasonable:&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=sum({&amp;lt;Date = {"&amp;lt;=$(=max([Cal.Date]))"}&amp;gt;} [Amount curr Rec])/&lt;BR /&gt; (Max({&amp;lt;CurrRates2.Date={"$(#vCurrRateNum)"}&amp;gt;}&lt;BR /&gt; If(CurrRates2.Trans.curr = Trans.curr, [CurrRates2.Curr rate]))&lt;BR /&gt; )&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Sorry for the long winded reply, but I didn't get that final expression until I finished typing up the other stuff. Take a look at the sample and see if that is what you are looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 16:54:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174326#M502566</guid>
      <dc:creator />
      <dc:date>2010-08-26T16:54:42Z</dc:date>
    </item>
    <item>
      <title>Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174327#M502568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understood the question:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Link the CurrRates2 table by Trans.curr (don't qualify it).&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;vCurrRateDate = =rangemin(max(Cal.Date),max(total Date))&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(aggr(sum({&amp;lt;Date={"&amp;lt;=$(=max(Cal.Date))"}&amp;gt;} [Amount curr Rec])&lt;BR /&gt; /only({&amp;lt;CurrRates2.Date={$(vCurrRateDate)}&amp;gt;} [CurrRates2.Curr rate])&lt;BR /&gt; ,Office,Customer,Trans.curr))&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;sum(aggr(sum({&amp;lt;Date={"&amp;lt;=$(=max(Cal.Date))"}&amp;gt;} [Amount curr Paym])&lt;BR /&gt; /only({&amp;lt;CurrRates2.Date={$(vCurrRateDate)}&amp;gt;} [CurrRates2.Curr rate])&lt;BR /&gt; ,Office,Customer,Trans.curr))&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;NMiller wrote:I think you want to Sum up all of the Rec or Paym values and then divide by the exchange rate. Is there any reason to divide each individual record by the exchange rate?&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You can't sum and then divide because there can be multiple currencies involved since our chart doesn't have currency as a dimension. But that doesn't force us to do all the work at the individual record level either. You can aggregate by the chart dimensions PLUS currency, and only do the division once for each unique combination you find. That's what I did above. I suspect it would be faster than doing it at the record level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;NMiller wrote:Sorry for the long winded reply, but I didn't get that final expression until I finished typing up the other stuff. Take a look at the sample and see if that is what you are looking for.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Heh. I should have read all the way through instead of just reading "I was unable to solve your problem" and then redoing most of your work from scratch. The only serious issue I see with your version is that when multiple currencies are involved (customer 3 or the total), you treat everything as rubles since that has the maximum exchange rate. That's why I'm using the aggr(). And the expression can be simplified by making the data model change I mentioned above, but that doesn't affect functionality.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Aug 2010 00:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174327#M502568</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-08-28T00:12:18Z</dc:date>
    </item>
    <item>
      <title>Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174328#M502571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx, John,&lt;/P&gt;&lt;P&gt;You understood the issue absolutely correct! That is exactly what I need.&lt;/P&gt;&lt;P&gt;I'm just not so fluently oriented in complicated Set Analysis expressions, but I knew, that you guys are&lt;/P&gt;&lt;P&gt;One again thanx a lot for everybody!!!&lt;/P&gt;&lt;P&gt;Best rgds,&lt;BR /&gt;AT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 07:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174328#M502571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-30T07:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Amounts in Base Currency Using Rate for the End of Period</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174329#M502573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amigo John&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sou do Brasil, poderia me orientar, tenho uma tabela que necessita ser atualizada todo final de mês, ou seja dia 30 ou 31 de cada mês, esta em excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E o seguinte tenho um valor po exemplo de&amp;nbsp;&amp;nbsp;&amp;nbsp; R$200,00&amp;nbsp; desde do ano de 2000, necessito atuliazado ela taxa selic acumulado todo final de mês.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inicial&amp;nbsp; 01/02/2000 -&amp;nbsp; data final&amp;nbsp; - 31/03/2015, este mesmo processo e feito para valores do ano 2001,2002 e 2003, sendo valores diferentes.&lt;/P&gt;&lt;P&gt;Poderia me ajuda a contruir um qvw, onde possa atualizar este valore automaticamente.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agradeço seu auxilio desde já&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 14:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Amounts-in-Base-Currency-Using-Rate-for-the-End-of/m-p/174329#M502573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-29T14:09:41Z</dc:date>
    </item>
  </channel>
</rss>

