Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
fashid
Specialist
Specialist

Expression not rounding off correctly

Hi,

Hi Experts,

I have an expression named MTD score which is not rounding off correctly

It should  round off to 17 but for some other reason it does not work.

I am attaching the sample qvw.

Also this error was captured on 25th Jan 2016 , so maybe if you want to open the qvw and replicate the issue you might have to change the clock on your system .

Regards,

Nadeem

1 Solution

Accepted Solutions
sunny_talwar

Have you looked at the link shared by Bill above? If you have not, look again -> Rounding Errors

View solution in original post

13 Replies
Anonymous
Not applicable

Have a read of this Blog Post by Henric :

Rounding Errors

sunny_talwar

The issue here is that the Column(3)'s output seems like its 92, but its actually 91.6666666 which leads to an MTD Score of 16.50. 16.50 is getting rounded to 16, instead of 17.

Capture.PNG

Not applicable

Firstly your MTD expression returning 85 not 92 so you are getting 15. Don't use ROund functions in your expressions.

Directly user the Number format on the Number tab.

sunny_talwar

I think that is because he is using Today() function and the issue was found on Jan 25th (3 days ago). I have attached the app with Today()-3. You can check it out there.

fashid
Specialist
Specialist
Author

hi Sunny ,

Now what should i do if i want the MTD score to be calculated on the rounded off MTD percentage column .

Regards,

Nadeem

sunny_talwar

Try this:

=if((((18/100)*Column(3))*100)>18,18,Round((((18/100)*Round(Column(3), 0.01))*100)))


Capture.PNG

HirisH_V7
Master
Master

Hi,

In your MTD Score Expression,

=if((((18/100)*Column(3))*100)>18,18,(((18/100)*Column(3))*100))

now for that particular loaded field is , 15.23

Hope this Helps,

PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
fashid
Specialist
Specialist
Author

Thanks a lot sunny,

But i plan to keep the expressions same as i have many of them and i suspect that it may cause further issues .

My question remains so as to why does qlikview not round off 16.50 to 17 .

When i use a text object and enclose 16.50 in the round function it gives me 17 but fails to do this in my chart.

Regards,

Nadeem

sunny_talwar

Have you looked at the link shared by Bill above? If you have not, look again -> Rounding Errors