Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Improving the accuracy of calculations

Hi,

I would like to have better accuracy of Qlik calculations and I am wondering if this is possible and what is the best way to go...

Here's the case.

I have a metric x that is calculated with (A-B)/C.

A, B, C are also calculated values.

When I get A, B, C calculated values separately from Qlik and calculate x offline (Excel, calculator, manually) I get value x1 (in % with precision >=3).

When I  ask Qlik to do the x calculation it returns a value x2  (in % with precision >=3)..

x1 and x2 can be as different as 3% which is not suitable for my case: I need x1 and x2 to agree on the second decimal at least.

Any ideas of how I can have x2 calculated more accurately by Qlik?

thx

Georgia

7 Replies
tresesco
MVP
MVP

Not sure if I understood right. Have you checked the number tab (of a chart)? You can set precision for metrics there.

Not applicable
Author

hi, Georgia

If your are using this calculation in graph or table go properties then number tab

select your expression and set your precision and decimal accuracy....

Regards

Fahad

Not applicable
Author

Hi and many thanks for your reply -

indeed I have checked that and all it does is increasing the number of decimals ie

if initial number is 15,34% (x2) this can get me to 15,33456...%

However I want my calculation to return something like 15,42% (x1 calculated offline with A,B, C also in Qlik, so same basis) which cannot be fixed with that.

thx

G

Not applicable
Author

Hi Fahad  and many thanks for your reply / same as above...

indeed I have checked that and all it does is increasing the number of decimals ie

if initial number is 15,34% (x2) this can get me to 15,33456...%

However I want my calculation to return something like 15,42% (x1 calculated offline with A,B, C also in Qlik, so same basis) which cannot be fixed with that.

thx

G

Not applicable
Author

Dear G

can you give me the value of

a,b,c for your expression (A-B)/C.

Regards

FAHAD

Not applicable
Author

May be you need to use round function in your expression....

if i assume your value

=round(15.33456,0.2)

=15.4%

Not applicable
Author

Hi Fahad,

I reproduced this in a straight table and discovered that there was an error in my A,B calcs inside the metric.

(not very suprising I suppose) which cause the discrepancy and not the accuracy of qlik.

I generally prefer laying calculations in detail in pivots rather than referencing other expressions, at the cost of human errors inserted.

thanks for the attention

G