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: 
Mr_Pearl
Creator II
Creator II

Filter pane - if function unexpected behaviour?

Chart: Filter pane

Expression:

=if(Sold=1,
'Sold'&Repeat(chr(160),15)&aggr(num(count({<Sold={1}>}Sold),'###,##0'),Sold),
'Yet to sell'&Repeat(chr(160),15)&aggr(num(count({<Sold={0}>}Sold),'###,##0'),Sold))

//Sold field has 0's and 1's as data

Expected outcome:

Sold       601,102

Yet to sell       209,125

Actual outcome:

Sold       601,102

Yet to sell       209,125

Yet to sell

Why I am getting an extra line (3rd row) in my filter pane that displays "yet to sell"? I dont want that 3rd row.

If you think I am doing the entire thing wrong, please advice. Any guidance will be helpful.

 

Labels (3)
1 Solution

Accepted Solutions
Mr_Pearl
Creator II
Creator II
Author

It was the Null values in "Sold" field that resulted in 3rd row. Altered the expression accordingly.

 

View solution in original post

1 Reply
Mr_Pearl
Creator II
Creator II
Author

It was the Null values in "Sold" field that resulted in 3rd row. Altered the expression accordingly.