Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use FieldValue() in Currency Convertion

Hello,

I need to implement currency conversion in order to convert any of the currencies proposed (Norwegian Krone (NOK), Euro, USD or Pound (GBP), by the date (currencies rates base in monthly values) the values available in a table.

I have a currency rate table, with all the corresponding values for the currencies, where I have a field with the concatenated values: ‘From-To-Year-Month’ that is called exchkey. I have tried to use the functions FieldValue and FieldIndex to get the corresponding Rate value from the table. At the beginning it seems to work ok, but I have realized it don’t return the correct rate value, only works for the first value in the table:

     

Doc. NumberNet ValueRate  Net value covertedValue 'exchkey'
4400033474Kr 210000,000,078439€ 16472,19NOK-EUR-2014-1
4400033481€ 320000,001€ 320000,00EUR-EUR-2014-1
4400033485$ 20880,008,838021€ 184537,88USD-EUR-2014-1
4400033502Kr 1361840,000,078439€ 106821,37NOK-EUR-2014-1

   

Exch. keyExRtFromToCurr Date Exch. RateCurr yearCurr month
EUR-EUR-2014-1XRATEEUREUR20140101120141
NOK-EUR-2014-1XRATENOKEUR201401010.11921320141
NOK-GBP-2016-1XRATENOKGBP201601010.07843920161
USD-EUR-2014-1XRATEUSDEUR201401010.73419820141
USD-NOK-2016-1XRATEUSDNOK201601018.83802120161

Could you help me with this case?. I would like to know if there are a mistake in the way I’m using FirldValue formula, or if the currency conversion should be done in the script side and not during the expressions calculation?.

Attached is the example of the application I have used.

Thanks in advance.

1 Reply
marcus_sommer

Please do not double-posting: How to use FieldValue() for Currency Convertion