Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

claudiojr69
New Contributor II

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
Employee
Employee

Re: Sum of product in pivot

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))

2 Replies
Employee
Employee

Re: Sum of product in pivot

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))

claudiojr69
New Contributor II

Re: Sum of product in pivot

Perfect! Thank you!

Community Browser