Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
some of my account numbers comes with seven zeroes in fornt, need to get rid of them, example below:
000000088899
0000000777111
00000003334
000000066666
should be presented as:
88899
777111
3334
66666
what would be the easiest way to remove these zeroes in the script?
Hi KN,
not sure how to implement it into my script.
Can you pls give me a hint?
//O
Hi,
The below script works fine
Load value,Num(value) as Value1;
Load * Inline [
value
000000088899
0000000777111
00000003334
000000066666
];
Please check.
Regards,
Jagan.
You can use this formula:
Num(PurgeChar(Text(FieldName), '0'), '000')
When you get leading zero's like that, it tends to be because Qlikview is interperating the field as a string. This tends to happen if there is leading or trailing whitespace, but also happens sometimes when one or more rows contain string data. So, my first port of call would be to do a trim(), so maybe try:
=trim(num(num#(val)))
If you're still having trouble, I'd check the rest of your data, and make sure you don't have any fields in there that are obviously text.
Try,
Purgechar(YourField,'0') as NewField
Hi
Please find the attached application, i solved with the help string functions
Regards
AR UMAMAHESH
Purgechar some times not good
suppose if the number have zero between the other numbers, purgechar will remove that one also
Hi,
try this
REPLACE
(LTRIM(REPLACE(Field_name, '0', ' ')), ' ', '0')
Regards,
Kavita
Hi,
Please use this.
Data:
Load *,
Purgechar(FIELD_Zero,'0') as FIELD_NoZero;
LOAD * INLINE [
FIELD_Zero
000000088899
0000000777111
00000003334
000000066666
];
EXIT Script;
This is the logic i implemented
Temp:
LOAD * INLINE [
Phone
000000088899
0000000777111
00000003334
000000066666
];
Final:
LOAD LTrim(Replace(Phone,'0000000','')) as PhoneNumber
Resident Temp;

