Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
rdsuperlike
Contributor

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.

Tags (1)
1 Solution

Accepted Solutions
Partner
Partner

Re: Lookup default value

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
Partner
Partner

Re: Lookup default value

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

anbu1984
Honored Contributor III

Re: Lookup default value

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

Re: Lookup default value

Hi!

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

Alt(

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

, 1)