Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AnneM
Contributor II
Contributor II

Change labels of map legend

Hi,

I have a question on a map object, my organization doesn't have Qlik geoanalytics extension so I don't know if I'm in the right location.

I have this map regarding soil quality

AnneM_2-1669820485598.png

I would like to change the legend text, instead of 2/5/6/7 it would be 'Très faible', 'Elevé', 'Très Elevé', 'Très Elevé'

I have tried this formula in the label ('étiquette' in my french version) part of the map object :

=if(ClasseP2O5=1,'Très Faible',

if(ClasseP2O5=2,'Très Faible',

if(ClasseP2O5=3,'Faible',

if(ClasseP2O5=4,'Correct',

if(ClasseP2O5=5,'Elevé',

if(ClasseP2O5=6,'Très Elevé',

if(ClasseP2O5=7,'Très Elevé')))))))

but it doesn't work. Is it possible to do so ?

I prefer to color by 'ClasseP2O5' rather than by the appreciation('Très Faible','Faible','Correct','Elevé','Très Elevé' etc ) because if I use the appreciation it's ordered alphabetically so 'Correct' is the first element, while I want'Très Faible'/1 to be my first element .

Thanks,

Anne

Labels (1)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can create a field like :

if(ClasseP2O5=1, Dual('Très Faible', 1),

if(ClasseP2O5=2, Dual('Très Faible', 2),

if(ClasseP2O5=3, Dual('Faible', 3),

if(ClasseP2O5=4, Dual('Correct', 4)

if(ClasseP2O5=5, Dual('Elevé', 5),

if(ClasseP2O5=6,Dual('Très Elevé', 6),

if(ClasseP2O5=7, Dual('Très Elevé', 7)))))))) as ClasseP2O5_ch

The dual fonction create a field with text and number. You can display the text and sort by number.

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

3 Replies
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can create a field like :

if(ClasseP2O5=1, Dual('Très Faible', 1),

if(ClasseP2O5=2, Dual('Très Faible', 2),

if(ClasseP2O5=3, Dual('Faible', 3),

if(ClasseP2O5=4, Dual('Correct', 4)

if(ClasseP2O5=5, Dual('Elevé', 5),

if(ClasseP2O5=6,Dual('Très Elevé', 6),

if(ClasseP2O5=7, Dual('Très Elevé', 7)))))))) as ClasseP2O5_ch

The dual fonction create a field with text and number. You can display the text and sort by number.

Help users find answers! Don't forget to mark a solution that worked for you!
AnneM
Contributor II
Contributor II
Author

That sounds great thanks ! Before I try it, can I include it in a mapping table ?

analyse_sol_mapping:
Mapping
LOAD * Inline [
classe, intitulé
1, Dual('Très Faible', 1)
2, Dual('Très Faible', 2)
3, Dual('Faible', 3)
4, Dual('Correct', 4)
5, Dual('Elevé', 5)
6, Dual('Très Elevé', 6)
7, Dual('Très Elevé', 7)
];

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

More like :

analyse_sol_mapping:
Mapping
LOAD

classe,

Dual(intitulé, class) as ClasseP2O5_ch

Inline [
classe, intitulé
1, Très Faible
2, Très Faible
3, Faible
4, Correct
5, Elevé
6, Très Elevé
7, Très Elevé
];

Help users find answers! Don't forget to mark a solution that worked for you!