Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
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
MVP & Luminary
MVP & Luminary

Re: replace string

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

View solution in original post

5 Replies

Re: replace string

Hi

Try with purgechar() or keepchar() option.

Other Function:

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

Not applicable

Re: replace string


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

MVP & Luminary
MVP & Luminary

Re: replace string

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

View solution in original post

MVP & Luminary
MVP & Luminary

Re: Re: replace string

Maybe better without the space:

MapDia: 

MAPPING LOAD * INLINE [ 

    F1, F2 

    ’,' 

    é,é 

    è,è 

    ',' 

    ô,ô 

    ê,ê  

];

- Ralf

Not applicable

Re: replace string


Of course !

Thanks a lot