Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik Sense: bar chart color by calculated dimension, gives only Null Values color

Dear Qlik enthusiasts:

I need to color a bar chart by calculated dimension, but it is not working. I searched the Community, found similar problems, but no clear explanation to the Sense behavior that I am experiencing. QVF attached.

Goal: classify supplier invoices into 2 categories

  • Potentially Duplicate (>1 invoices for same value and supplier)
  • Not duplicate (only 1 invoice with this value)

Preferably without creating additional columns in the script.

And color the 2 dimension values in a bar chart.

Here is my data:

data.png

I have a calculated master dimension that works:

if(Aggr(Count(distinct [Invoice Nr]), [Supplier Nr],[Value])>1,'Potential Duplicate','Not duplicate')

dim wroks.png

I have assigned colors to the 2 values returned by this calculated dimension:

assigned colors.png

I dragged the dimension in the chart to color by dimension, like in this tutorial‌. However, if I use Colors = Auto, the chart is colored using "Null Values" color (red)!

null color.png

Could you please point where I made an error?

Thank you,

Igor.

1 Solution

Accepted Solutions
mdmukramali
Specialist III
Specialist III

Hi,

Maybe bug,

But work around is here :

Color :

Color by Expression.

=if(Aggr(Count(distinct [Invoice Nr]), [Supplier Nr],[Value])>1,LightMagenta(),LightBlue())


281471.PNG

View solution in original post

6 Replies
shraddha_g
Partner - Master III
Partner - Master III

change it to color by dimension and switch on library colors

linoyel
Specialist
Specialist

It seems like a bug... any workarounds maybe?

mdmukramali
Specialist III
Specialist III

Hi,

Maybe bug,

But work around is here :

Color :

Color by Expression.

=if(Aggr(Count(distinct [Invoice Nr]), [Supplier Nr],[Value])>1,LightMagenta(),LightBlue())


281471.PNG

Anonymous
Not applicable
Author

Not helping.

Anonymous
Not applicable
Author

Thank you Mohammed, this works.

Seems like Sense bug indeed.

Basically, this means that for now, until this functionality is fixed, I have to maintain 2 similar formulas:

  • For the calculated dimension
  • For the color expression
linoyel
Specialist
Specialist

Hi Igor, I've tried this solution as well, and it doesn't work for me.

Which QS version are you using?