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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
marco_puccetti
Partner - Creator
Partner - Creator

Number of digits

Hello i need to get the number of digits of a specific number, how can i do this?

In this case, if i have 12345 i need to get a mask of this type 11111.

Marco

1 Solution

Accepted Solutions
MarcoWedel

not the shortest solution, but also possible to get the length of an integer:

Floor(Log10(Number))+1

regards

Marco

View solution in original post

6 Replies
hic
Former Employee
Former Employee

Len(Number) perhaps?

HIC

tresesco
MVP
MVP

And to get mask, try like:    Repeat(1, Len(YourNumber))

marco_puccetti
Partner - Creator
Partner - Creator
Author

It's ok if the Len function return the number of digits of number; in these cases, what is the function return values:

11.888.432.122,67

1.500.039,55

I expect 13 for the first and 9 for the second, while i get 14 for the first and 9 for the second.

Thanks

hic
Former Employee
Former Employee

Not sure I understand how you want to count...

If you just want the digits, you can use Len(Keepchar(Number,'0123456789'))

If you just want the integer part (including thousand separators), you can use Len(Floor(Number))

HIC

MarcoWedel

not the shortest solution, but also possible to get the length of an integer:

Floor(Log10(Number))+1

regards

Marco

marco_puccetti
Partner - Creator
Partner - Creator
Author

Thanks a lot this works perfectly!!

Marco