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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Sum of product in pivot

Hi guys,

I know there are lots of similar questions to this but couldnt find any that suited me.

I'm trying to get the sum of products from a pivot table (second table) rather the sum of the totals (first table).

My expession is

=Sum({<Tipo = {"STD"},Q=,[Mês]=,Valor = {"HRS"},Ano={$(=Getfieldselections(Ano))}>} Montante)*

(Sum({<Tipo = {"ACT"},Q=, Valor = {"HRS"}>} Montante)-Sum({$<Tipo={$(=GetFieldSelections(Tipo))},Valor = {"HRS"},Q=>} Montante))

Any help? Thanks a lot!

Sem título.png

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Please try (adjust your field names)

Sum(Aggr(

Sum({<Tipo = {"STD"},Q=,[Mês]=,Valor = {"HRS"},Ano={$(=Getfieldselections(Ano))}>} Montante)*

(Sum({<Tipo = {"ACT"},Q=, Valor = {"HRS"}>} Montante)-Sum({$<Tipo={$(=GetFieldSelections(Tipo))},Valor = {"HRS"},Q=>} Montante)), BRAND, PLANT))

View solution in original post

2 Replies
Clever_Anjos
Employee
Employee

Please try (adjust your field names)

Sum(Aggr(

Sum({<Tipo = {"STD"},Q=,[Mês]=,Valor = {"HRS"},Ano={$(=Getfieldselections(Ano))}>} Montante)*

(Sum({<Tipo = {"ACT"},Q=, Valor = {"HRS"}>} Montante)-Sum({$<Tipo={$(=GetFieldSelections(Tipo))},Valor = {"HRS"},Q=>} Montante)), BRAND, PLANT))

Anonymous
Not applicable
Author

Perfect! Thank you!