Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rupaliqlik
Creator
Creator

How to convert text to number in qliksense script level

Hi ,

How to convert text to numbers in Qlik sense. Values are coming at left side in column. when tried to export and sum it is not allowing to sum.

Tried below function but still not working.

num(num#( QTY , '#.###', ',' , '.')) AS QTY

rupaliqlik_0-1633609541718.png

 

@abhijitnalekar 

Thank You,

Rupali

 

 

 

1 Solution

Accepted Solutions
abhijitnalekar
Specialist II
Specialist II

Hi @rupaliqlik ,

 

I will suggest you to just use

num#(QTY) as QTY in the script  and rather than using formatting at expression level use custom number formatting from properties.

abhijitnalekar_0-1633612058787.png

 

Hope this solve your issue.

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

3 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @rupaliqlik ,

 

I will suggest you to just use

num#(QTY) as QTY in the script  and rather than using formatting at expression level use custom number formatting from properties.

abhijitnalekar_0-1633612058787.png

 

Hope this solve your issue.

 

 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
richardwilde
Contributor III
Contributor III

Yes I also tried using num() and it didn't work, but num#() did. Don't really understand why and it doesn't seem intuitive to me, but at least I got it working now.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @richardwilde 

It is obvious if you study what each of those functions do:

num - it is formatting function. it applies number mask/format on numerical value. It expects input value to be number and it applies a mask on that number: https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/Scripting/Formatt...

num# - it is interpretation function. It expects input to be a string in certain format and it will convert it to a numerical representation: https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/Scripting/Interpr...

I encourage going through documentation when using functions so I can make educated and right decision on which function to use in which scenario.

Similar functions apply to Dates, Time, Timestamp, Money etc.. data types presented as numbers or text.

 

Hope that clarifies why one of the function works and why other didnt in your case.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.