Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
garystrader
Partner - Creator III
Partner - Creator III

Num#() converting numbers to 32 bit signed integer

I'm wondering if this is a bug.  When the num#() function is used in combination with any arithmetic operation, such as *1, it takes a number that is above the upper range of 32 bit signed integers (>2147483647), and flips it to a negative number.  None of the other expressions below does this.  It does this whether they're created as field in the load script or as expressions in charts.

Untitled.png

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

It should be use like this

Num#(2147483649,'##########')*1

or

Num#(2147483649,'#')*1

View solution in original post

6 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Did you checked with the help file?

Its for number conversion by specfying the format of the number.

The num# function evaluates the expression numerically according to the string given as format-code. Decimal separator and thousands separator can be set as third and fourth parameters. If the parameters 2-4 are omitted, the default number format set by script variables or in the operating system is used.

Are you using windows OS then Go to control panel-->Regional and language settings and the check the default format if the exceeds the specified limit again starts from the negative value(the remaining difference)

garystrader
Partner - Creator III
Partner - Creator III
Author

Thanks for the response.  The issue isn't formatting - it's changing the value of the number.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

It should be use like this

Num#(2147483649,'##########')*1

or

Num#(2147483649,'#')*1

swuehl
MVP
MVP

Gary,

I think your issue is probably very close to

http://community.qlik.com/message/152802

(I assume using an arithmetic operator with num#() is similar to applying num() on num#() )

garystrader
Partner - Creator III
Partner - Creator III
Author

That works.  Thank you very much.

Swuehl, I tried going to that link but it says that I'm unauthorized.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It is odd. I note that the use of any format mask (arg 2) fixes the problem. For example,

=num#(2147483648,'#')*1

displays correct. I suppose others may have not seen this problem because I can't think of a case where you would use num#() without a mask.

-Rob