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: 
bwisealiahmad
Partner - Specialist
Partner - Specialist

Wrong with calculation? Don't understand what I am doing wrong

Hi,

I've made a fact table with some information:

Sum(NettNet) - How much money was made that period

% of Total - Supposed to be multiplied with Sum(NettNet) to get a certain amount that was made that day

Sum(NettNet) * % Of Total = Sum(Omsetning)

I did all of this is the script.


When I have % Of Total and Omsetning as Dimensions they show right values. Moment I try to Sum them to up to them as Measures the numbers become much higher.


Any ideas?


Sum(NettNet) should be the same as Sum(Omsetning) just that Sum(Omsetning) is the daily value that sums up to the total of Sum(NettNet)


Doh.JPG

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Your Sum() expressions are exactly 9x the Omsetning and % Of Total values. Which means they occur 9 times within your Dimension, in this case Dato.  Take a look at your data model using Preview in the Data Model Viewer and try to understand why you have duplicates in your data model.


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

4 Replies
eduardo_dimperio
Specialist II
Specialist II

Hi Ali,

Try SUM(Distinct YourField)

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Hi,

You can see on  row 4 & 5 it looks like the same values so I don't want it distinct.

What I am trying to understand if it is a modeling error or what I've done.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Your Sum() expressions are exactly 9x the Omsetning and % Of Total values. Which means they occur 9 times within your Dimension, in this case Dato.  Take a look at your data model using Preview in the Data Model Viewer and try to understand why you have duplicates in your data model.


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

bwisealiahmad
Partner - Specialist
Partner - Specialist
Author

Hi,

Was missing a Distinct  on a Interval Match join

Thank you!


Best,

Ali A