Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Okay so if you want to remove leading zeros from a field value it's fairly straightforward if you search the forums there are a couple of solutions available such as-
Num(FieldName)replace(ltrim(replace(MyField,'0',' ')),' ','0')
but say you want to remove leading zeros numbers in a comma separated list.
So...
123456789,0123456789,0000444444
Would be transformed into
123456789,123456789,444444
The reason I'm asking is that I have a qlikview document that allows a user to paste comma separated lists into a variable input box and it searches normalised (read leading zeros removed) Id field by producing a string like (123456789|0123456789|0000444444). I need to get it to search for (123456789|123456789|444444) instead. Is there an easy way of achieving this?
Many Thanks
vString: 1234567809,01234567890,0000444444
Search string: ='(' &concat( num( subfield(vString,',',ValueLoop(1,1+SubStringCount(vString,','))) ) ,'|') & ')'
How about purgechar( Field,'0')?
Its good but it would cause problems in values like 001234560458 being transformed into 123456458 rather than the desired 1234560458..
vString: 1234567809,01234567890,0000444444
Search string: ='(' &concat( num( subfield(vString,',',ValueLoop(1,1+SubStringCount(vString,','))) ) ,'|') & ')'
That works incredibly! Will need to spend some time working out how but a brilliant response.
Many Thanks
Felix