Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to read latest exchange rates

Hi all, Please help

I have a currency table which has a key and currency code something like

Currency Key    Code

1                       USD

Similarly I have Exchange Table which has exchange rates and Currency Key , lastupdated date and other fileds

Currency Key                    Rate                            LastUpdate

4                                      0.73                             2014-07-19 16:00:50

4                                      0.69                             2014-07-19 14:00:30

and so on

Now, I need to read the last updated rate for a particular currency key and match it agianst the currency code.

I am able to read last updated date data for example when I say Max date, I get multiple records which are updated on the same day at different times, I need to get only  one latest updated record for each currencykey with last updated date and time, for example for currencykey 4 as shown above. i need to only the record updated at 2014-07-19 16:00:50

Could someone help me on how to go about it please?

Thanks in advance

11 Replies
Not applicable
Author

Thanks,this works good, except I can give this condition at script level, when given as expression it gives me right numbers, is there a way to specify this at script level, I dont think we can use aggr function, I tried using group by , but no luck

Not applicable
Author

Hi all,

Need help again,

Now I have the updated values in place for the corresponding currencies, I have another table which a balances data and their corresponding CurrencyKey, I have to divide each value for balance in this table to equalize the currency to USD, these two tables have common CurrencyKey, but I tried directly dividing by the exchange rate field since the balance values are updates at different timngs the aggregate function is valuating to differennt timings and providing multiple exchange rates for the same currencykey.

How should I go about this? should acreate a qvd for the original table I created?

Please help