Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Replace string * in load script

Dear experts,

in load script I want to replace one string and it doesn't work:

In the column ItsTestColu I have different values: AVI SU, AVI SUS, AVI SUU...

I want to reset this all "AVI S*" through "AVI"

LOAD replace(ItsTestColu, 'AVI SU*', 'AVI') as Test2,

FROM ...

Why * is not working ?

I try it also with wildmatch, and it is also not working:

replace(ItsTestColu, wildmatch(ItsTestColu, 'AVI SU*'), 'AVI')

In this load script I cannot and I don't want use somethin LEFT.. I just want to use "ALL" / " * "

Kind regards,

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
MVP
MVP

Replace() is the wrong function to use here. replace() replaces individual characters, not strings. Instead use:

if(ItsTestColu LIKE  'AVI SU*', 'AVI', ItsTestColu) as ItsTestColu


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

May be try this:

If(Left(ItsTestColu, 7) = 'AVI SU', 'AVI', ItsTestColu) as Test2

tamilarasu
Champion
Champion

Andre,


You can also try,


If(WILDMATCH(ItstestColu, 'AVI SU*'),'AVI',ItsTestColu) as Test2

rwunderlich
MVP
MVP

Replace() is the wrong function to use here. replace() replaces individual characters, not strings. Instead use:

if(ItsTestColu LIKE  'AVI SU*', 'AVI', ItsTestColu) as ItsTestColu


-Rob

http://masterssummit.com

http://qlikviewcookbook.com