Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

rounding off number figure problem

Hiya

I need to stop a sum from rounding off a number

e.g the correct answer should show 5.5...but I get 6

can you please show me how I can edit this code below to stop this

num( sum(Target), $(= chr(39) & $(=$(vFormat)) & chr(39)))

note: this part is needed to convert number to percentage (= chr(39) & $(=$(vFormat)) & chr(39)))

Kind Regards

Joeybird

1 Solution

Accepted Solutions
Employee
Employee

Re: rounding off number figure problem

I think this is related to an earlier post .

If that is true and you used a vFormat variable with this definition...

set vFormat='if(Only(Format)=' & chr(39) & 'Integer' & chr(39) &',' &chr(39)& '#,##0' & chr(39) & ',' & chr(39) & '#,##0%' & chr(39) & ')';


...then try changing


#,##0%


to


#,###.0%


or


#,###.#0%


(the last has 2 decimals, the 2nd last has 1 decimal)

3 Replies
awhitfield
Esteemed Contributor

Re: rounding off problem

Hi JoeyBird,

Can you post an example qvw

andy

Employee
Employee

Re: rounding off number figure problem

I think this is related to an earlier post .

If that is true and you used a vFormat variable with this definition...

set vFormat='if(Only(Format)=' & chr(39) & 'Integer' & chr(39) &',' &chr(39)& '#,##0' & chr(39) & ',' & chr(39) & '#,##0%' & chr(39) & ')';


...then try changing


#,##0%


to


#,###.0%


or


#,###.#0%


(the last has 2 decimals, the 2nd last has 1 decimal)

joeybird
Contributor II

Re: rounding off number figure problem

hiya

#,###.0%

worked!!!!

awesome possum!!!

thanks again x

Kind Regard

joeybird

Community Browser