Within QlikView you could do it in this way: Colors in charts. If this could be used respectively adpated in Qlik Sense I don't know - maybe this is helpful as starting point: Qlik Sense: How to set custom colors by measure in a bar chart
It seems you use variable and variable extension to change the dimension in your graph or table
for exemple vDimGEO with value 1 for country and value 2 for city.
so try in the color panel menu this mesure ( to adapt to your requierment)
easy if your number of country and city is low
If you have a lot of country and city another approch would be better as you mentionned a table with distinct colors attached to each value of countries and cities.
Hope it helps otherwise
This works perfectly. You are right this is very usefull if the dimensions have a few values. So I have set the colors for the dimensions that have lest than 10 possible values. And I would like for the other dimensions to let Qlik choose the colors. But in the expression if I do not set a specific color for each value than the value not specified are set in a light grey. Is there a function to call the standard color from Qlik?
Or, how does it work to define color by loading a table? because this could be very usefull anyway for me in the futur. I did a few trails but it doesn't work... I looked if there was already a topic on this but I found nothing...
Thanks again for your help
Glad to read it works.
"Is there a function to call the standard color from Qlik?" :
No rather than you use default setting colors , or color defining by expression but not twice as the same time.
Or, how does it work to define color by loading a table? : never use this possibility but i'am sure i'had read a post about this. let me chek
Don't find the post about this but see attached qvf example with excel data
the trick is to create a table with red green blue field and value for each basic RGB color and field for country and the same table but with cities ( in my example i took 4 frenchs departement and some towns)
Then in your bar chart you have a variable to jump from departement or cities dimension with this mesure as dimension :
you add this in your script for each color table :
rgb("Red","Green","blue") as color_dept
(ooxml, embedded labels, table is dept_color);
and for cities :
rgb("Red","Green","blue") as color_ville
(ooxml, embedded labels, table is town_color);
and in the color panel add this mesure :
and that's ok