Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conversion rates expression

Hi Forum,

I've a straight table like below,        

ProjectEmployeeWorkDateWorkHoursBaseCurrencyEuropeExpenseDenmarkExpensesHungaryExpenses
100ABC12-04-20166EUR120000
100ABC13-04-20167EUR140000
100XYZ12-04-20165DKK05000
100XYZ13-04-20168DKK08000
100ABC14-04-20168EUR160000
100OPQ14-04-20169HUF001800

and now my client wants like below,

          

ProjectEmployeeWorkDateWorkHoursBaseCurrencyTransactionRateEuropeExpenseDenmarkExpensesHungaryExpensesUSDExpense
100ABC12-04-20166EURNA1200001200*15 = 18000
100ABC13-04-20167EURNA1400001400*15 = 21000
100XYZ12-04-20165DKKNA05000500*0.8 = 400
100XYZ13-04-20168DKK0.808000800*0.8 = 640
100ABC14-04-20168EUR151600001600*15 = 24000
100OPQ14-04-20169HUF0.20018001800*0.2 = 360

where i need to write an expression for USDExpense and transaction rates given to convert other expenses(EUR, DKK and HUF) into USD.

Since TransactionRate is Null or Notavailable for first record(BaseCurrency-EUR)(workdate: 12-04-2015), USDExpenses expression should pick latest EUR TransactionRate that is available i.e 15(record 5) and same case for other Employees belongs to different countries having different currencies and rates.

please suggest how to achieve USDExpenses expression?

Thanks in advance,

Narsi

1 Reply
sunny_talwar

You want to do this in the script or directly on the front end of the application? Where is TransactionRate coming from and where are the defauly values for TransactionRate coming from?