Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression in Chart

Hi,

I have a Pivot chart item with expression as

 

Count

(DISTINCT{$<Flag={1},Arrears_new={'Yes','No'}>}[Estate Code])

I need to see the result as 1 instead of 'Yes' and 0 instead of 'No'. could anyone help me how to change this in Pivot chart.

Thanks

1 Solution

Accepted Solutions
sparur
Specialist II
Specialist II

If you mean that the count()  function returns only 2 values (1 or 0), so, as I understand, it's possible only when you have only 1 [Estate Code] per Arrears_New.

If I'm right, I recommend to use such expression: Only(Arrears_New) (instead of count() function).

Or you could use a dirty approach like this: if (count(....) = 0, 'No', 'Yes')

View solution in original post

8 Replies
tresesco
MVP
MVP

Not sure if you are asking for this:

Count(DISTINCT{$<Flag={1},Arrears_new={1,0}>}[Estate Code])

If not this, please explain a bit more.

abeyphilip
Creator II
Creator II


if(<your current expression> ='Yes',1,0)

sparur
Specialist II
Specialist II

Amelia, could yu specify what you have in demensions?

anyway, I can't understand how do you get Yes and No as a result of Count() function. As I understand, this expression return a numbers of [Estate Code].

What do you try to achieve?

sparur
Specialist II
Specialist II

This current expression can't return Yes or No . It will return a number...

khadeer
Specialist
Specialist

Hi,

Create one more flag in script as if(Arrears_New='Yes',1,if(Arrears_New='No',0)) as Arrears_New

And then use count(DISTINCT{$<Flag={1},Arrears_new={1,0}>}[Estate Code])

Regards,

Khadeer

Not applicable
Author

I need to get instead of 1 Yes and instead of 0 No

sparur
Specialist II
Specialist II

If you mean that the count()  function returns only 2 values (1 or 0), so, as I understand, it's possible only when you have only 1 [Estate Code] per Arrears_New.

If I'm right, I recommend to use such expression: Only(Arrears_New) (instead of count() function).

Or you could use a dirty approach like this: if (count(....) = 0, 'No', 'Yes')

Not applicable
Author

Thanks Anatoly, It's working.