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: 
Not applicable

Color Expression for stacked bar graph not working

I have an issues apply colors correctly to a stacked bar chart

I always want to show 2 years of data, I get that done

I want to apply colors based on a field, that works when ... either everything is selected or nothing is selected

I've attached a file to show what I mean

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Maybe like

only({1}

IF(group = 'A',RGB(84,130,53),

IF(group = 'B', RGB(101,156,64),

IF(group = 'C', RGB(121,187,76),

IF(group = 'D', RGB(145,224,92)))))

)

View solution in original post

4 Replies
swuehl
Champion III
Champion III

Maybe like

only({1}

IF(group = 'A',RGB(84,130,53),

IF(group = 'B', RGB(101,156,64),

IF(group = 'C', RGB(121,187,76),

IF(group = 'D', RGB(145,224,92)))))

)

Not applicable
Author

That did the trick.

Can you maybe expand on the use of that ONLY({1} )??

I'm new to qlik and not familiar with it's uses

swuehl
Champion III
Champion III

The set expression (have a look at chapter 'set analysis' in the Help) with set identifier 1

{1} is forcing QV to ignore all user selections for that aggregation.

You can use set expressions only within aggregation functions like sum(), count(), and yes, only().

Not applicable
Author

Ok, so I get the set analysis part of {1} to ignore all selections.  I guess I'm not familiar with the aggregation is only()