Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add a sum field in a pivot table

Hi guys,

I've this problem to solve and I'm asking your help, because I have not yet found a solution.

In a QlikView sheet I have two tables:

- The first is a table with these columns (CodArt is the key): CodArt Val1 Val2 ... Vali

- The second is a table with these columns (Article/Date is the key): Article Date Qnty (Qnty is an integer)

With a MasterCalendar I'm filtering the data of the second table.

There are other tables connected to these.

The columns Article and CodArt of the two tables contain the same data, but I can't call both CodArt because of circular references with other tables.

Now I'd like to add to the *first table* a column "SumOfQnty"  which is the sum of the field Qnty of the *second table*

with the filter Article=Codart.

The sum should be consistent with the selection of the data of the master calendar.

Is it possible to add this field?

Which formula should I use?

Thank you very much

Claudio

1 Reply
swuehl
MVP
MVP

That's hard to answer without knowing your data model a bit more detailed. Could you upload a small sample QVW?

You can try something like

=Sum( If( CodeArt = Article, Qnty))

but this may not work as expected (but it's even not 100% clear what you are expecting here). Depending on your data model, the possible values of both dimensions can differ, also the record set for measure Qnty can be different in the context of chart1 compared to chart2.