Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Strange Sum-result in Qlikview

Dear Qlikviewers,

I am encountering a issue where I don't understand why Qlikview applies the logic that it does.

Let me explain below.

I have a database with two tables (simplified example below):

DataBusinessDay
ShipmentdateShipmentdate
ShipmentsMTD_BusinessDay

After loading, I make a straight table, which ends up like this:

2015-04-23_110052.png

We see the Shipmentdate from both tables as the key, the MTD_BusinessDay from the right table and the SHP from the left.

So far, so good. However, when you manually add up the figures, you come to 1.239.298 instead of the 1.112.575 Qlikview shows.

I have found out what happens: in the table, you can see that MTD_BusinessDay 8 and 13 both have 14-4-2014 as Shipmentdate.

This is intentional, so this is exactly like it's supposed to be. However, Qlikview now only adds ONE of the two in the SHP-total.

The formula used for the SHP is:

=sum({$<Shipmentdate={'<=$(=vYesterdayLastYear)'},MTD_BusinessDay={'<>0'}>} SHP)

where vYesterdayLastYear = 23-4-2014.

My question now is: why does Qlikview only add the SHP once when calculating the total?

And: is there a way to force Qlikview to make the right sum?

Thanks in advance!

KR,

Stefan

1 Solution

Accepted Solutions
PrashantSangle

Hi,

Use AGGR()

try below

Sum(AGGR(sum({$<Shipmentdate={'<=$(=vYesterdayLastYear)'},MTD_BusinessDay={'<>0'}>} SHP),shipmentdate,MTD_BussinessDay))

In Aggr() write your dimension of chart.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

3 Replies
PrashantSangle

Hi,

Use AGGR()

try below

Sum(AGGR(sum({$<Shipmentdate={'<=$(=vYesterdayLastYear)'},MTD_BusinessDay={'<>0'}>} SHP),shipmentdate,MTD_BussinessDay))

In Aggr() write your dimension of chart.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Like a charm! Can't believe I have been searching for 30 minutes and didn't think of this... Thansk a lot Max!

PrashantSangle

You Welcome

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂