Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I try to divide two Sums but get a complete wrong answer.

I have several rows in my dataset. I would like to divide the total sum for one dimension with the total sum of another one.

The sum for one of the dimensions is 1873520 and the sum I would like to divide with is 1889. I would like the result to be approx 991.8..., but instead I get 0.68875... How is this possible and how can I write to get it right?

I have tried the following:

Sum(Costs) / Sum(Items)

Sum(TOTAL Costs) / Sum(TOTAL Items)

Sum(TOTAL Costs) / Sum(Items)

Sum(Costs) / Sum(TOTAL Items)

Sum(TOTAL Sum(Costs)) / Sum(TOTAL Sum(Items))

...they all end upp with 0,68875....


I have also tried to made variables of them. Variable1 = Sum(Costs) and Variable2 = Sum(Items) - But the result of Variable1 / Variable2 = 0,68875...


Does it have something to do with QlikView dividing "row by row" and then sum-up??

1 Solution

Accepted Solutions
rubenmarin

Hi Jorgen, Costs is an interval value, this is used to measure time, in this number format a unit (1)=1day, so 20 minutes are equal to 1/24/60*20 (0.01388..)

You can adding the Costs values as: =Sum(Num#(Costs,'0'))

View solution in original post

2 Replies
rubenmarin

Hi Jorgen, Costs is an interval value, this is used to measure time, in this number format a unit (1)=1day, so 20 minutes are equal to 1/24/60*20 (0.01388..)

You can adding the Costs values as: =Sum(Num#(Costs,'0'))

Anonymous
Not applicable
Author

Thanks a lot!!!