Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When using color > By expression instead of Auto color at a bar chart or combo, none of pick(match(), if(), and variable set works.
pick(match(status,'approve','cancel'), yellow(), red())
if(status='approve', yellow(), if(status='cancel', red()))
pick(match(status,'approve','cancel'), $(vapprove), $(vcancel))
I set dimension and measure as below.
Count({$ <status={'approve'}>} station)
Count({$ <status={'cancel'}>} station)
and the data table is
test:
load ActionDate, if ( isnull(Project ),'Unknown', Project) as Project , Approval
Inline [ ActionDate, Project , Approval
2/4/2021, a , cancel
2/4/2021, b, approve
2/4/2021, c, approve
2/5/2021, b, cancel
2/5/2021, a, approve
2/5/2021,c,approve
2/8/2021, c, approve
2/10/2021, a, approve
2/10/2021, b, cancel
2/10/2021, c, approve
3/15/2021,a, approve
3/15/2021, c, cancel
3/16/2021, c, cancel
];
Hi, you can't give two different color to one dimension value using that expression, may-201 has both values, so when you ask for status and it has more than value it returns null(), it only returns a values when ther is only one value, that's why it only paints the first and the last bar.
For that kind of chart you don't need a combo, you can do a bar chart with month-year and approval as dimensions and just Count(Station) as measure.
If you have approval defined as master dimension you can assign colors to each value of the dimension and use dimension colors on bar chart