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: 
bhaveshp90
Creator III
Creator III

How to convert string to number?

Hello,

I have a table as shown below; When selected Code = 17 the value is showing as 0

1.PNG

For Code = 17, the value is a string which is why my expression is not working.

Sum(Num#(Forecast_Cost_to_Complete,'###,###,###'))


Any ideas how to resolve this?

thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try adding a format for the negative numbers into the format string: =num#('(1234,12)', '#,##0.00;(#,##0.00)' , ',' , '.' )


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Try adding a format for the negative numbers into the format string: =num#('(1234,12)', '#,##0.00;(#,##0.00)' , ',' , '.' )


talk is cheap, supply exceeds demand
sujana1621
Contributor III
Contributor III

Try this sum(num#(replace(replace(Forecast_Cost_to_Complete,'(',''),')',''),'####')

bhaveshp90
Creator III
Creator III
Author

thank you gwassenaar‌. It worked out. slight change I have removed '.' and is working well.

=Num(Sum(Num#(Forecast_Cost_to_Complete,'###,###,###;(###,###,###)' , ',')),'###,###,###,###')

aolaleye
Contributor II
Contributor II

Thanks for sharing this tip. 😁It solved my problem and all my numbers showed on the report. It seems they were initially stored as strings