Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
bhaveshp90
Contributor 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
MVP & Luminary
MVP & Luminary

Re: How to convert string to number?

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
3 Replies
MVP & Luminary
MVP & Luminary

Re: How to convert string to number?

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
New Contributor II

Re: How to convert string to number?

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

bhaveshp90
Contributor III

Re: How to convert string to number?

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

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