# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Valued Contributor

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

1 Solution

Accepted Solutions
MVP

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

4 Replies
Valued Contributor II

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

Hi Ali,

Try SUM(Distinct YourField)

Valued Contributor

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

MVP

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

Valued Contributor

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