Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

1 Solution

Accepted Solutions
MVP
MVP

Re: Color Expression for stacked bar graph not working

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)))))

)

4 Replies
MVP
MVP

Re: Color Expression for stacked bar graph not working

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

Re: Color Expression for stacked bar graph not working

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

MVP
MVP

Re: Color Expression for stacked bar graph not working

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

Re: Color Expression for stacked bar graph not working

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()

Community Browser