Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
conor_gallagher93
Contributor III
Contributor III

Qlik Sense Automatically Rounding Incorrectly

I'm working on building an app that displays shows the share of cases considered satisfactory ('Sat') to all cases. I'm using the below code:

Count({<[CSRcall_combine.OverallScore] = {'Sat'}>}[CSRcall_combine.Eval_Dim_ID])/Count([CSRcall_combine.Eval_Dim_ID])

I am trying to validate the result against the data source, and I am seeing that for one month, I have the result 83.6% in my source data, but I have 83.5% in Qlik. I changed the format to include more decimal places, and it seems that the result in my source data and in Qlik is 83.55%. For some reason, Qlik is rounding this down rather than up to 83.6%. Does anyone know of a way to change the system settings so that they automatically round 5's up rather than down?

10 Replies
martinpohl
Partner - Master
Partner - Master

have a loop to help

If you are rounding a floating point number you may observe erroneous results. These rounding errors occur because floating point numbers are represented by a finite number of binary digits. Therefore, results are calculated using a number that is already rounded. If these rounding errors will affect your work, multiply the numbers to convert them to integers before rounding.

It's another type of calculation/storing the datas.

Regards

conor_gallagher93
Contributor III
Contributor III
Author

Can you clarify what you mean in the context of my expression? Are you saying that I need to change:

Count({<[CSRcall_combine.OverallScore] = {'Sat'}>}[CSRcall_combine.Eval_Dim_ID])/Count([CSRcall_combine.Eval_Dim_ID])

To instead say:

(Count({<[CSRcall_combine.OverallScore] = {'Sat'}>}[CSRcall_combine.Eval_Dim_ID])/Count([CSRcall_combine.Eval_Dim_ID]))*100

Or do you mean something else?

martinpohl
Partner - Master
Partner - Master

I would say

((Count({<[CSRcall_combine.OverallScore] = {'Sat'}>}[CSRcall_combine.Eval_Dim_ID])*100)/(Count([CSRcall_combine.Eval_Dim_ID]))*100)

test it in a textbox before

Regards

conor_gallagher93
Contributor III
Contributor III
Author

Unfortunately that does not fix the issue. I still end up with an 83.55% that rounds down to 83.5% instead of correctly rounding up to 83.6%.

martinpohl
Partner - Master
Partner - Master

so what are the basic numbers of your expression?

I try to recalculate it.

Regards

conor_gallagher93
Contributor III
Contributor III
Author

So the issue is appearing for a specific month of data. When I use a filter pane to filter the results, I get:

Count({<[CSRcall_combine.OverallScore] = {'Sat'}>}[CSRcall_combine.Eval_Dim_ID])/Count([CSRcall_combine.Eval_Dim_ID]) = 22,769 / 27,253 = 0.835467

martinpohl
Partner - Master
Partner - Master

but here you got it:

83,5467% = 83,547% = 83,55% = 83,5%

Excel is also calculation because the 4th number (4) is lower than 5

Regards

conor_gallagher93
Contributor III
Contributor III
Author

Okay, then the issue must be that Qlik rounds differently than the source data set.

martinpohl
Partner - Master
Partner - Master

This could be, for that you need the calculation rules from the system.

Maybe there some intermediates results are created, you don't know.

Regards