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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
has75042
Creator
Creator

Need help with what function to use

I have a requirement where I want to add 2 leading  zero if the department is 1 character, if it is 2 character 1 leading zero and if it is 3 leave is as it is. 

So From the attached file  I need something like this

000,002,003,004....012,013,014....104,108

 

Any help would be greatly appreciate it.

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try one of these

Num(Dept_No, '000') as Dept_No

or

Text(Num(Dept_No, '000')) as Dept_No

 

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

Try one of these

Num(Dept_No, '000') as Dept_No

or

Text(Num(Dept_No, '000')) as Dept_No

 

vamsee
Specialist
Specialist

Try 

Text(IF( Len(Dept_No) <3,  Repeat( '0', 3-Len(Dept_No))& Dept_No,Dept_No )) as Dept_No