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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

If expression KPI QlikSense

I try the following expression:

if([Contract Type]='Valid',Count([Contract Type]))

and it give me null value!!

any help please

3 Replies
ogster1974
Partner - Master II
Partner - Master II

Try count({<[contract type]={'Valid'} >} contractid) no if statement required.

Assuming you are wanting the number of valid contracts.

Regards

Andy

tomasz_tru
Specialist
Specialist

Set analysis is recommended for performance reasons and there is at least one case where IF would give you wrong result. Point 2b in the link below:

Using “IF” in expressions vs using “Set Analysis” | QlikView Help, Tips & Hints

martinpohl
Partner - Master
Partner - Master

although the other answers are right that a set Analysis for performance reasons are the better solution:

count(if([contract type]='Valid',[contrace type])

works.

Regards