Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a bar chart which shows data over a country dimension. I am using set analysis to ignore the country selection, so that all countries always appear. What I want to have happen is when a user selects countries from a list box the relevant bars in the chart change color. For example, if all the bars are blue and I select USA, the USA bar becomes green. If they Ctrl+Click on Canada so they have two countries selected, those two bars would be green.
What's throwing me is the need to check against multiple selected values. I was thinking that I'd put an if statement in the background color expression of the expression in the chart, but I'm not sure how to do it to check against all selected values. if(country = ???, RGB(0,255,0), RGB(0,0,255))
Hi,
I did not try but following may work:
=if(SubStringCount(Concat(Distinct Country), Country)>0, Green(), Blue())
Regards,
Hi,
use this Exprsssion
=if(country= Concat(Getcurrentselections(country),','), RGB(0,255,0), RGB(0,0,255)).
this is helps to solve ur problem.
Regards
Perumal A
Hi,
I did not try but following may work:
=if(SubStringCount(Concat(Distinct Country), Country)>0, Green(), Blue())
Regards,
Hi Bilge Aydin,
your expression is working properly... Cn you explain how you used SubString in the expression??
- yojas
Hi,
SubStringCount function takes 2 parameters and it searches how many times the 'Parameter 2', appears in 'Parameter 1'. For example:
SubStringCount('GermanyFranceNetherlandsFrance', 'France') --> returns 2.
So, in the expression, I compared the COUNTRY with the list of selected countries.
"Concat(Distinct Country)" returns the list of selected countries as a concatenated string (e.g. 'GermanyFranceItalySpain'). And the IF statement checks if the COUNTRY is in the list of selected countries. If the COUNTRY is in the list, then the IF statements returns GREEN else it returns BLUE.
Pls. let me know if it is not clear.
Regards,
Thanks for explanation...