Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use null in the set expression

Hi Team,

As per the requirement, i have to use the null in the set expression. Can anyone please let me know how to use the NULL in the Set expression.

i have used the expression like,

Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN','NULL'}

Please let me know the correct usage of null in the set expression.

Thanks and Regards,

Smitha

5 Replies
Not applicable
Author

You should be able to catch null values just passing single quotes with no spaces as a Modifier value:

Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN',''}

This is in case null values have not been treated in Script layer in order to place a NULL text instead or something..

tresesco
MVP
MVP

Try like:

Asset={"=$(='Active Directory' or 'Iphone' or 'Microsoft Exchange' or 'VeriSign Certificate' or 'VPN' or IsNull(Asset))"}

Or,

<Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN'}> + <Asset={"=$(=IsNull(Asset))"}>

Hope somebody can suggest a simpler one.

jagan
Luminary Alumni
Luminary Alumni


Hi Smitha,

In Script just add a flag for null like this

LOAD

*,

Alt(Asset, 'N/A') AS TempAsset

FROM DataSource;

Now use this field in set analysis

=Count({<Asset=, TempAsset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN','NULL'}>} ID)

or

in set analysis

<Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN'}> + <Asset={"=$(=IsNull(Asset))"}>

Regards,

Jagan.

Gysbert_Wassenaar

This should work:

<Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN'}> + <Asset-={'*'}>


But it's far easier to replace the nulls in the script:


Load

    field1, field2, ...etc,

    if(len(trim(Asset))=0,'n/a', Asset) as Asset

From ...mysource...;


Then use that n/a value in the set modifier:

<Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN','n/a'}>


talk is cheap, supply exceeds demand
MayilVahanan

Hi

Try like this

<Asset={'Active Directory','Iphone','Microsoft Exchange','VeriSign Certificate','VPN'}> + <Asset-={'*'}>

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.