4 Replies Latest reply: Aug 30, 2017 2:00 AM by Ali Ahmad

# 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)

• ###### Re: Wrong with calculation? Don't understand what I am doing wrong

Hi Ali,

Try SUM(Distinct YourField)

• ###### Re: Wrong with calculation? Don't understand what I am doing wrong

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.

• ###### Re: Wrong with calculation? Don't understand what I am doing wrong

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://qlikviewcookbook.com

• ###### Re: Wrong with calculation? Don't understand what I am doing wrong

Hi,

Was missing a Distinct  on a Interval Match join

Thank you!

Best,

Ali A