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

Lookup default value

How to set a default in lookup. I want to default my value of Grossdata = 1 if there is no match.

Lookup('dpw','key',NAME &'-' & VENDOR  &'-' & Year(DATE) &'-' & Month(DATE)  ,'Grossdata')

Any help is appreciated.

1 Solution

Accepted Solutions
lucianoginqo
Partner - Contributor III
Partner - Contributor III

did you try

if(isnull(Lookup('dpw','key',NAME &'-' & VENDOR  &'-' & Year(DATE) &'-' & Month(DATE)  ,'Grossdata')),1,Lookup('dpw','key',NAME &'-' & VENDOR  &'-' & Year(DATE) &'-' & Month(DATE)  ,'Grossdata'))

This might not be the most efficient way but it should accomplish what you need?

View solution in original post

3 Replies
lucianoginqo
Partner - Contributor III
Partner - Contributor III

did you try

if(isnull(Lookup('dpw','key',NAME &'-' & VENDOR  &'-' & Year(DATE) &'-' & Month(DATE)  ,'Grossdata')),1,Lookup('dpw','key',NAME &'-' & VENDOR  &'-' & Year(DATE) &'-' & Month(DATE)  ,'Grossdata'))

This might not be the most efficient way but it should accomplish what you need?

anbu1984
Master III
Master III

Tbl:

LOAD * Inline [

Key,Value

1,aaa

2,bbb ];

Load *,If(IsNull(Lookup('Value','Key',Key,'Tbl')),'Default',Lookup('Value','Key',Key,'Tbl')) Inline [

Key

1

2

3 ];

Not applicable

Hi!

Is result numeric? Then what about "RangeSum" or "Alt"?

Alt(

     Lookup('dpw','key',NAME &'-' & VENDOR  &'-' & Year(DATE) &'-' & Month(DATE)  ,'Grossdata')

, 1)