Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
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
May be try this:
If(Left(ItsTestColu, 7) = 'AVI SU', 'AVI', ItsTestColu) as Test2
Andre,
You can also try,
If(WILDMATCH(ItstestColu, 'AVI SU*'),'AVI',ItsTestColu) as Test2
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