Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SUM TOTAL and AVG

Dear all,

I need a solution for my problem. I want to use the totals of the tables below for further calculations.

There must be a solution, but I couldn't find it. I tried AGGR, sum(total <field>), but without result.

code-order.gif

Order 960 has 5 codes of 30 and order 961 has 1 code of 30.

I need the following figures:

- Total Orderbedrag = 180

- Avg Orderbedrag = 90

- Avg Bonbedrag = 30

Can you help me with this?

Kind regards,

Erwin

19 Replies
MK_QSL
MVP
MVP

Can you share your sample data please?

Not applicable
Author

Can you share a sample app with small data?

Not applicable
Author

Hi Manish and Shyamal,

This comes from my DB, so I do not have sample data. Or can I export this to excel?

kind regards,

Erwin

MK_QSL
MVP
MVP

Just give us few lines in excel...

Not applicable
Author

Hi All,

I will add two xls files. Kind regards, Erwin

MK_QSL
MVP
MVP

SUM([Order Amount])

SUM(TOTAL [Order Amount])/COUNT(TOTAL DISTINCT OrderId)

or

SUM([Order Amount])/COUNT(DISTINCT OrderId)

Dont have idea about

Avg Bonbedrag = 30

Not applicable
Author

Hi Manish,

This does not seem to work.

below the results of your expressions:

code-order-v2.gif

MK_QSL
MVP
MVP

What is the dimension you are using?

Not applicable
Author

It doens't matter if I use orderId or codeId.

the sum total stays the same.