Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

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
JonnyPoole
Former Employee
Former Employee

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)

View solution in original post

3 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi JoeyBird,

Can you post an example qvw

andy

JonnyPoole
Former Employee
Former Employee

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
Creator III
Creator III
Author

hiya

#,###.0%

worked!!!!

awesome possum!!!

thanks again x

Kind Regard

joeybird