Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
saimahasan
Partner - Creator III
Partner - Creator III

Rounding problem

Hi,

I am stuck with rounding off. Basically i am trying to get the sum and then take the rounding value but wherever there is 5 after decimal it does not round whereas for rest of the values it rounds.

Please find attached sample data.

11 Replies
prieper
Master II
Master II

Do not see the problem, rounding works ....

ROUND(SUM(AMMORTISED_COST), 1)     rounds the .5 up to the next full digit

FLOOR(SUM(AMMORTISED_COST), 1)      would round all decimals down the the full digit ...

saimahasan
Partner - Creator III
Partner - Creator III
Author

If i take =Round(Sum(MARKET_VALUE) - Sum(AMMORTISED_COST)) it doesnt work

saimahasan
Partner - Creator III
Partner - Creator III
Author

Please look at this attachment.

prieper
Master II
Master II

Please use

Round(Sum(MARKET_VALUE) - Sum(AMMORTISED_COST), 1)

saimahasan
Partner - Creator III
Partner - Creator III
Author

Not working

prieper
Master II
Master II

pfa

saimahasan
Partner - Creator III
Partner - Creator III
Author

Thanks. Now i just want to clear my doubt. Is it that QV doesn't round off the number with decimal .5 to the nearest upper integer??

prieper
Master II
Master II

I cannot reproduce your behavior, as per help the default is set to "1":

Round(x[, step[, offset]])  

Return data type: numeric

Arguments:

ArgumentDescription
x   Input number.
step   Interval increment. The default value is 1.
offset  

Defines the base of the step interval. The default value is 0.

Even, if using ROUND without parameter, I get the result as desired.

Else please post an example of your qvw.

saimahasan
Partner - Creator III
Partner - Creator III
Author

So, in your QVW the output which is getting generated is matching with mine. But can i get the output as -22531192 and not as -22531191 since the base number is -22531191.5