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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Purge string

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?

25 Replies
Not applicable
Author

Pls find attached example files.

pokassov
Specialist
Specialist

num(evaluate([ACCOUNT NUMBER])) as [ACCOUNT NUMBER],

sasiparupudi1
Master III
Master III

try
Replace([ACCOUNT NUMBER],'0000000','') as [ACCOUNT NUMBER],

kavita25
Partner - Specialist
Partner - Specialist

Check the qvw.

qlikviewwizard
Master II
Master II

Hi,

Please use this.

Data:

Load *,

REPLACE(LTRIM(REPLACE( [ACCOUNT NUMBER], '0', ' ')), ' ', '0') as [ACCOUNT NUMBER_1],

Replace([ACCOUNT NUMBER],'0000000','') as [ACCOUNT NUMBER_2];

LOAD [AS OF DATE],

     VER,

  [ACCOUNT NUMBER],

     AMOUNT

FROM

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Not applicable
Author

Great stuff. No idea what the evaluate function does but seems like it's working