Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

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

5 Replies
mayilvahanan
Not applicable

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

rbecher
Not applicable

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

rbecher
Not applicable

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