Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

replace string

Hello

In the ETL part, I'm getting string from a database

Unfortunately some had the bad idea to encode diacritic as html in the database

so in the sql select I'm doing such tricky thing to make replacement


replace(replace(replace(replace(Replace(Replace(detdsc.discrepancyreason,'’',''''),'é','é'),'è','è'),''',''''),'ô','ô'),'ê','ê') as discrepancyreason,

Is there some easiest way to do that in Qlikview ?

Thanks for your help

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hi Oliver,

I think you can just copy the replace expression and use it in Qlikview LOAD. Another efficient way is to use MapSubstring() function:

MapDia:

MAPPING LOAD * INLINE [

    F1, F2

    ’, '

    é, é

    è, è

    ', '

    ô, ô

    ê, ê'

];

Data:

LOAD MapSubString('MapDia', discrepancyreason) as discrepancyreason, ...

- Ralf

Astrato.io Head of R&D

View solution in original post

5 Replies
MayilVahanan

Hi

Try with purgechar() or keepchar() option.

Other Function:

TextBetween() , mid(), index() function also there, it depends on your requirement.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author


Thank you

Unfortunately it seems that the function you are proposing will be even much more tricky than the replace I'm doing in SQL mode

rbecher
MVP
MVP

Hi Oliver,

I think you can just copy the replace expression and use it in Qlikview LOAD. Another efficient way is to use MapSubstring() function:

MapDia:

MAPPING LOAD * INLINE [

    F1, F2

    ’, '

    é, é

    è, è

    ', '

    ô, ô

    ê, ê'

];

Data:

LOAD MapSubString('MapDia', discrepancyreason) as discrepancyreason, ...

- Ralf

Astrato.io Head of R&D
rbecher
MVP
MVP

Maybe better without the space:

MapDia: 

MAPPING LOAD * INLINE [ 

    F1, F2 

    ’,' 

    é,é 

    è,è 

    ',' 

    ô,ô 

    ê,ê  

];

- Ralf

Astrato.io Head of R&D
Not applicable
Author


Of course !

Thanks a lot