Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the correct aggregated sum?

Hi Gurus,

Probably a simple answer to this, but I am a QlikView freshman.

I need to sum all rows (sum of CostCompFrom) to get the right Amount, but I can not sum the Quantity rows (the right value should be 204, not 6121).

1) How can I achieve this and get the result in one row if I remove the CostCompFrom dimension in a chart?

2) How would I achieve the same result by using a load statement?

Thanks in advance,

Freddy

Data (simplified):

WeekDayOrderNumberCostCompFromQuantityAmount To
6 1217529,38
2418WC30004021000204437,72
2418WC30004022000204142,34
2418WC30004022010204259,77
2418WC30004023000204203,61
2418WC30004023010204146,12
2418WC30004023012204393,34

1 Solution

Accepted Solutions
john_duffy
Partner - Creator III
Partner - Creator III

Hello.

I'm not sure if I'm understanding your data structure correctly. You should be able to create a chart with Week, Day, OrderNumber and Quantity as dimensions and an expression Sum([Amount To]).

To achieve this in a load script something like:

Load Week, Day, OrderNumber, Quantity, Sum([Amount To])

From xxxx.qvd

Group by Week, Day, OrderNumber, Quantity

Let me know if this helps.

View solution in original post

2 Replies
john_duffy
Partner - Creator III
Partner - Creator III

Hello.

I'm not sure if I'm understanding your data structure correctly. You should be able to create a chart with Week, Day, OrderNumber and Quantity as dimensions and an expression Sum([Amount To]).

To achieve this in a load script something like:

Load Week, Day, OrderNumber, Quantity, Sum([Amount To])

From xxxx.qvd

Group by Week, Day, OrderNumber, Quantity

Let me know if this helps.

Not applicable
Author

Hi,

Of course! 🙂

This works. Thanks!