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

accented letters in the script

Hi,

I need to rename some provinces to insert in a map.
What I've done so far is:

LOAD
PAESE,
REGIONE as REGIONE_SOURCE,
If(REGIONE = 'TRENTINO ALTO ADIGE', 'TRENTINO-ALTO ADIGE',
IF(REGIONE = 'EMILIA ROMAGNA', 'EMILIA-ROMAGNA', REGIONE)) as [REGIONE],
PROVINCIA as PROVINCIA_SOURCE,
if(PROVINCIA = 'PESARO URBINO', 'PESARO E URBINO',
if(PROVINCIA = 'CARBONIA IGLESIAS', 'SUD SARDEGNA',
if(PROVINCIA = 'MEDIO CAMPIDANO', 'SUD SARDEGNA',
if(PROVINCIA = 'MONZA BRIANZA', 'MONZA E DELLA BRIANZA', PROVINCIA))))) as [PROVINCIA]
...

One of them has an accented letter (Forlì Cesena). Does someone know how to manage it in the script?
I need to convert 'Forlì Cesena' into 'Forlì-Cesena'.

 

Thanks in advance.

Labels (3)
5 Replies
marcus_sommer

nbuscemi
Contributor III
Contributor III
Author

Would you be so kind as to adapt to my script? I've no programming skills, it's a bit difficult for me to comprehend.

 

Thank u!

marcus_sommer

Maybe something like this:

m: mapping load * inline [
F1, F2
TRENTINO ALTO ADIGE, TRENTINO-ALTO ADIGE,
EMILIA ROMAGNA, EMILIA-ROMAGNA
];

LOAD
PAESE,
REGIONE as REGIONE_SOURCE,
applymap('m', REGIONE, REGIONE) as [REGIONE],
...

- Marcus

 

nbuscemi
Contributor III
Contributor III
Author

Thank you, I'm trying, but still facing issues with some provinces. 

I'll figure it out!

 

Regards

marcus_sommer

If you load these mapping-data from a external source (file or db) and not per inline-load you shouldn't have trouble with these accent-chars. If really want to maintain this within the script you try to escape this char with a second one whereby this char isn't a pure accent else some kind of special-char … 

- Marcus