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

On what basis both tables are linked with each other?

Not applicable
Author

code-order-tableview.gifI've attached screenshot

MK_QSL
MVP
MVP

But you haven't provided proper sample data files !

Not applicable
Author

Manish Kachhia schreef:

Just give us few lines in excel...

I created a few lines in excel, just like you asked...

This should be enough for the problem, right?

Kind regards, Erwin

MK_QSL
MVP
MVP

I don't find any common field in your excel files which can link these two tables...

qlikpahadi07
Specialist
Specialist

Hi Erwin,

I have gone through the thread but it is not clear what exactly your issue is.

You have to create dummy data or export properly with out put you need.

as you mentioned "Order 960 has 5 codes of 30 and order 961 has 1 code of 30." it seems you can create this dummy data in Excel with 3 tabs as tables with output you needed.

cheers!!!

Not applicable
Author

I uploaded a new file with the connecting ID.

MK_QSL
MVP
MVP

Like this?

Not applicable
Author

Sorry I cannot open this document, because I am on personal license...

MK_QSL
MVP
MVP

Create a Straight Table

Dimension = Orderid

Expressions

SUM(Amount)

SUM([Order Amount])

SUM(TOTAL<OrderId> [Order Amount])

SUM(TOTAL <CodeId,OrderId>[Order Amount])/COUNT(OrderId)

COUNT(CodeId)

AVG(Amount)