Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Store value as Num

Hi Community

I have account no as below, how to make the account no '979987980000000' become a number, all the account no aligned to the right?

Num.PNG.png

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

But if it is an account number, it would be better to treat it as a unique key instead of as a number. I would instead remove the numeric interpretation by wrapping it in the Text() function:

     Text(AccountNo) as AccountNo

HIC

View solution in original post

10 Replies
MK_QSL
MVP
MVP

QlikView supports a maximum of 14 digits in your number. If it is longer than that,  it will be interpreted a a text.

First, you can use evaluate() to convert your original text into a integer.Then, you can use NUM to format it appropriately


Try Below

num( EVALUATE(YourFieldName),'#0') AS YourFieldName

er_mohit
Master II
Master II

Try this

Evaluate(AccountNo) as N,

hic
Former Employee
Former Employee

But if it is an account number, it would be better to treat it as a unique key instead of as a number. I would instead remove the numeric interpretation by wrapping it in the Text() function:

     Text(AccountNo) as AccountNo

HIC

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try Num(), otherwise you can align all the values to the right by changing

Properties -> Presentation -> Alignment -> Text and Numbers to Right

Hope this helps you.

Regards,

Jagan.

sunilkumarqv
Specialist II
Specialist II

Hi SurynnChin,

Its easy on presentation tab make alignment as right .

Hope i got your solution

Anonymous
Not applicable
Author

Can you elaborate more? Is there any advantage to store the account number as a text instead of num?

Not applicable
Author

hi

try this

since NumFormat has capacity to display 14 digit number. more than 14 digit number show in text.

for this use it.

Evaluate(AccountNo) as AccountNo_new


hic
Former Employee
Former Employee

I assume that AccountNo is an ID that you will use only as a key or selection field, and that you will never make any arithmetic calculations with it. If so, there are no longer any major advantages with having it as a number. (Except that a number takes less space in RAM than a string.)

Further, you have an account number that cannot be represented exactly as a number. You can use Evaluate() to assign a numeric value to it, but you will lose information. For instance, the following two account numbers will be assigned the same numeric value:

   979987980000000000

   979987980000000001

So, the advantage with storing it as text, is that you don't lose any information: The two account numbers above will still be two separate account numbers.

HIC

ashwanin
Specialist
Specialist

use text(AccountNo) as AccountNo