Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Newhaven
Contributor III
Contributor III

Example LookUp Function

Hy!

 

Cann anyone explain me the LookUp function?

I have a table like this (means e.g. 2021 100-199km = Zone 1...)

Year from km Zone
2021 100 1
2021 200 2
2021 300 3
2022 80 1
2022 110 2
2022 200 3

 

Now I want to get the corect zone for example

Year Km Zone LookUp
2021 205 2
2022 85 1


In excel with LookUp easy, but how does it works in qlikview script?

Thx

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Qlik Lookup() function cannot lookup values "between".  It only matches on specific values. 

To accomplish what you want, it's best to generate all the discrete values in the ranges using either IntervalMatch or a While loop.  

Example using a While loop here: https://qlikviewcookbook.com/recipes/download-info/expand-a-pricing-date-table/ 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Qlik Lookup() function cannot lookup values "between".  It only matches on specific values. 

To accomplish what you want, it's best to generate all the discrete values in the ranges using either IntervalMatch or a While loop.  

Example using a While loop here: https://qlikviewcookbook.com/recipes/download-info/expand-a-pricing-date-table/ 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

Newhaven
Contributor III
Contributor III
Author

Thx for the input. Find my solution 🙂