Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have a calculated dimension in a bar chart and an expression where I have set a condition in the background tab in order to get the bars in different colors. However, it doesn't work, it only works if I go to another sheet and make a selection there which includes some values of my dimension and then go back to the chart. Does someone know the problem?
The first expression will not work since you don't have any field references in it.
The second could work - if you have "account" as dimension, but I assume that you don't. If you don't, "account" will evaluate to NULL - since there are several possible accounts. It could even be that you have school accounts and office accounts on the same line. Hence, you need to add an aggregation function.
Read more here: Use Aggregation Functions!
HIC
What does your color expression look like?
HCI
The calculated dimension is if(account=42 or if(account=44, 'School', if(account=43 or if(account=45, 'Office'))))
And then I have an expression like Sum(Costs) and the color expression I tried both:
=If('School', Red(), if('Office', Green())) and also tried
=if(account=42 or if(account=44, 'Red(), if(account=43 or if(account=45, Blue()))))
The first expression will not work since you don't have any field references in it.
The second could work - if you have "account" as dimension, but I assume that you don't. If you don't, "account" will evaluate to NULL - since there are several possible accounts. It could even be that you have school accounts and office accounts on the same line. Hence, you need to add an aggregation function.
Read more here: Use Aggregation Functions!
HIC
Thank you Henric, I included the only function and it works!