Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
abc_18
Creator II
Creator II

How to add a default value

Hi,

In our script we are generating one field value using below script:-

if(left(bkey_bd_company,1)='#','CFN','BD') as "NEWCO id"


NEWCO id

BD

CFN


Now the requirement is to add another value as by default 'BARD'. so the user should be able to see values as if none of the above condition is true:-


NEWCO id

BD

CFN

BARD


1 Reply
tresesco
MVP
MVP

You have already defined the ELSE part in your expression and it is returning DB as default. To have another value as default, you must have at least one more condition, like:

You have now :

If ( XX='Cow', 'Animal', 'Not-animal')

To have default third value, you would need something like:

If( XX='Cow', 'Animal', If( XX='Tree', 'Tree', 'Neither animal nor tree'))