Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how i get the 0 in the beginning of the numbers

hi all,

i would like to know how i can show number 0 in this example:

i have field name Serial and the contact like that: "CCA 0101000","CCA 0101002","CCA 0101003"

"it 11 characters after CCA have space" and when i need to show just numbers i user that code: max(right(Serial , 7)) as S.N

the result i get is : "101000","101002","101003"

how can i show the first 0 by code?

thanks

1 Solution

Accepted Solutions
jsomsen
Creator III
Creator III

Another option if you must use the Max function:

MAXSTRING(RIGHT(Serial, 7)) AS S.N



View solution in original post

8 Replies
syed_muzammil
Partner
Partner

Hi,

Max will return the numeric value therefore you don't get a 0. If the 0 is always ther in the field then you just append a 0 to the Max field.

'0'&Max(....) as SN

Regards,

Syed Muzammil.

Not applicable

try this:

text(right(Serial , 7)) as S.N

Not applicable

Try put mask in your result

Ex.:

=Num(max(right((Serial , 7)), '0000000')

jsomsen
Creator III
Creator III

Another option if you must use the Max function:

MAXSTRING(RIGHT(Serial, 7)) AS S.N



View solution in original post

Not applicable

thanks jsomsen it´s working ... your answer is perfect... thanks alot

Not applicable

Even right(Serial , 7) as S.N will work...Just remove the max() from your code and check it...

Not applicable

i can´t remove the max because i need to get the last Serial .... thanks

Not applicable

also with jsomsen answer to user maxstring i not need to divide the cell with "right"