Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
andrea0901
Creator
Creator

Applymap query

Hi,

Actually below is my requirement:

 

Currency dateExchange rateDocument DateLookup
11.01.20194.2087012.01.2016#N/A
10.01.20194.2329512.02.2016#N/A
09.01.20194.2369511.01.20194.2087
08.01.20194.2103510.01.20194.23295
07.01.20194.2013509.01.20194.23695
04.01.20194.2032008.01.20194.21035
03.01.20194.1866507.01.20194.20135
02.01.20194.1758004.01.20194.2032
28.12.20184.2070503.01.20194.18665
27.12.20184.2092502.01.20194.1758
26.12.20184.1959528.12.20184.20705
21.12.20184.1885027.12.20184.20925
20.12.20184.1901526.12.20184.19595
19.12.20184.2100021.12.20184.1885
18.12.20184.1865020.12.20184.19015
17.12.20184.1780019.12.20184.21
14.12.20184.1657518.12.20184.1865
13.12.20184.1460517.12.20184.178
12.12.20184.1758514.12.20184.16575
11.12.20184.1681013.12.20184.14605
10.12.20184.1780012.12.20184.17585
07.12.20184.1958511.12.20184.1681

first A, B, C columns i have pulled. 

i have to derive the 4th column (i.e Lookup)

First i need to search whether the document date is present in Currency date, if the exact date is there then i have to derive that date's exchange rate column. 

Second, if the document date is not equal to currency date, i need to take the next highest date based on the document date and derive that date's exchange rate column. 

 

could u please help in qlikview how to derive the whole scenario.

2 Solutions

Accepted Solutions
Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand

View solution in original post

andrea0901
Creator
Creator
Author

Thank you for your reply Gysbert. I understood the logic what you have written.

Just one clarification.

If document date is not equal to currency date, then for that particular document date exchange rate should be next highest currency date exchange rate. 

so is this logic applied in that code. Please clarify .

View solution in original post

4 Replies
Gysbert_Wassenaar

See attached qvw


talk is cheap, supply exceeds demand
andrea0901
Creator
Creator
Author

Thank you for your reply Gysbert. I understood the logic what you have written.

Just one clarification.

If document date is not equal to currency date, then for that particular document date exchange rate should be next highest currency date exchange rate. 

so is this logic applied in that code. Please clarify .

Gysbert_Wassenaar

Yes, the logic for that is included. First the exchange rates are created for the missing dates. Once all the dates exists and have an exchange rate any document date can be looked up. Well, except those from 2016 for which no exchange rates were available in the data.


talk is cheap, supply exceeds demand
andrea0901
Creator
Creator
Author

Thank you so much Gysbert. Thanks for your help.