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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Evan0211
Creator II
Creator II

Checking for a null variable in set analysis

I have a KPI that expresses as:

=count(DISTINCT {<[OFFICE_CODE]={"=Match([OFFICE_CODE],$(vFilterOffice))"}>
* $(=right(left('$($(vFilter))', len('$($(vFilter))') - 1), len('$($(vFilter))') - 2))

} [Title])

This works correctly when vFilter is initiated, however upon load, it is not initiated, which is causing my KPI to print at -.

The expressions upon load expresses as * -

Is there a way to check if vFilter is null or empty on load?

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

You used already len(var) - why not also for if(len(var), your's ..., 'default value'). Another approach may be:

coalesce(Expression, 'please define vFilter')

- Marcus

View solution in original post

2 Replies
srchagas
Creator III
Creator III

Hello

if you want to count null values i strongly suggest you to use Null as values 

NullAsValue ‒ Qlik Sense on Windows

then you user one special character to that and user count distinct base by the particular character 

marcus_sommer
MVP
MVP

You used already len(var) - why not also for if(len(var), your's ..., 'default value'). Another approach may be:

coalesce(Expression, 'please define vFilter')

- Marcus