Skip to main content
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,

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/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

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
Partner Ambassador/MVP
Partner Ambassador/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