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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Srinivas
Creator
Creator

prefix avoid zeros in dimension

Dear all,

Before Avoid zeros in My dimension.

can you resole ASAP..

000000000000001613
000000000000001614
000000000000001615
000000000000001616
000000000000001617
000000000000001618
000000000000001619
000000000000001620
000000000000001621
000000000000001622
000000000000001623
000000000000001624
000000000000001625
000000000000001626
000000000000001627
000000000000001628
000000000000001629

Thanks

Reddy

1 Solution

Accepted Solutions
veidlburkhard
Creator III
Creator III

Hi Munna,

I loaded your data with leading zeros into QV and found this solution:

LOAD RawData,

  replace(ltrim(replace(RawData,'0',' ')),' ','0') as NumData

FROM

[http://community.qlik.com/thread/110099]

This expression in a first step replaces all zeros with spaces, then the ltrim function eleminates all leading zeros. At last zeros which have been replaced in the relevant number with spaces, too are again switched to zeros.

Leading Zeros.jpg

Hope this helps

Burkhard

View solution in original post

18 Replies
giakoum
Partner - Master II
Partner - Master II

if it is always 4 digits then right(YourField, 4) would do it.

Or num# function to make it appear as number, eliminating leading zero's

Not applicable

Munna,

I would use the functions

rangemin() to get a minimum between two data  (we are not sure it will always begin with 0)

mid() to extract part of a string

findoneof() to know where to find one letter in a string

Please try this (I did not test myself):

mid(MyField, rangemin(findoneof(MyField, '123456789'), 1)) as MyField

Fabrice

jerem1234
Specialist II
Specialist II

You could try:

num(FIELD) or

num(num#(Field))

Hope this helps!

srchilukoori
Specialist
Specialist

Findoneof() is a good option.

Right(<Field Name>, Len(<Field Name>) - FindOneOf(<Field Name>,'123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()-=_+[]{}\|;:,.<>/?')+1)

SC.

SunilChauhan
Champion II
Champion II

SUPPOSE THIS DATA COMES UNDER FIELDAME COLOUMN. THEN USE FOLLOWS

MID(FIELDNAME,FINDONEOF(FIELDNAME,'123456789'),lEN(FIELDNAME)-1)

HOPE THIS HELPS

Sunil Chauhan
bgerchikov
Partner - Creator III
Partner - Creator III

Here is the simple one:

num(num#(replace(NumberExpression,'00000','')),'0000')

for some reason Num# doesn't work directly with this data.

Not applicable

Easiest I can think of:

Its its in number format:

num(Field,'0')

In String format:

num(num#(Field),'0')

Thanks

AJ

Srinivas
Creator
Creator
Author

Hi Fabrice,

It's not working can you do another solution it would be great help full....

Thanks& Advance

Munna

Srinivas
Creator
Creator
Author

My Dear Friend,

I tried but,It's not working can you do another solution it would be great help full....

Thanks& Advance

Munna