Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
maxim1500
Partner - Creator
Partner - Creator

Sense : Color expression not respecting set analysis

I am trying to apply a color expression based on a value stored in my fact table on a bar chart. Since the fact table contains historical data, I applied a filter to get only current data.

Dimension: FactTableName.SegmentName

Measure: Sum({$<FactTableName.IsCurrent = {"true"}>}[FactTableName.TotalValue])

Everything is working so far. If I filter on a single entity, I get a single bar for his latest segment name.

But if I try to add a color expression like this:

if([FactTableName.SegmentID]=1,rgb(0,51,102),if([FactTableName.SegmentID]=2,rgb(51,51,255),if([FactTableName.SegmentID]=3,rgb(0,153,153))))

A second bar appears with a zero value (bar not visible but segment name appears on the axis) for the entity's previous segmentation.

I get the same issue with treemaps, scatter plots, etc.

Any idea on how to fix this? Color expression should not have an impact on data presentation other than setting the color...

1 Solution

Accepted Solutions
paul_scotchford
Specialist
Specialist

Correct it should not affect the data preso, but I noticed in your IF there is no final colour outcome (Else) , I have added an rgb to the last else in you IF construct, see below, see how you go

if([FactTableName.SegmentID]=1,rgb(0,51,102),

if([FactTableName.SegmentID]=2,rgb(51,51,255),

if([FactTableName.SegmentID]=3,rgb(0,153,153),rgb(255,250,230)

)))

Best regards

Paul

View solution in original post

2 Replies
paul_scotchford
Specialist
Specialist

Correct it should not affect the data preso, but I noticed in your IF there is no final colour outcome (Else) , I have added an rgb to the last else in you IF construct, see below, see how you go

if([FactTableName.SegmentID]=1,rgb(0,51,102),

if([FactTableName.SegmentID]=2,rgb(51,51,255),

if([FactTableName.SegmentID]=3,rgb(0,153,153),rgb(255,250,230)

)))

Best regards

Paul

maxim1500
Partner - Creator
Partner - Creator
Author

Thanks for your support. Indeed, I was missing the else condition. As for my initial issue, it is currently being escalated to the R&D team. Issue QLIK-52432.