Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AitorK
Contributor
Contributor

Set analysis - Calculating using a expression on the same pivot table

Hi,

I have a pivot table with a expression that uses a variable (__PeriodoATCBaja) for calculating a sum:

     = Sum ({$<[PeriodoHasta]={$(__PeriodoATCBaja)}>} [AtCompletion_Baja])

But instead of using this variable (which has a single value for all the pivot table) i want to calculate the sum based in the next expression which i have already added in  the pivot table:

    = aggr(MAX({< [AtCompletion_Baja] = {'>0'} >} [PeriodoMovto]), [Oferta])

           (This expreson label is FechaBajaOfer]

The purpose is to make the sum for each row according to the expression value in FechaBajaOfer.

 

I try the expression below but it always returns 0:

     =Sum({$<[PeriodoHasta]=FechaBajaOfer>}[AtCompletion_Baja])

If I use the variable for the expresion the result is:image.pngimage.png

Thanks in advance

3 Replies
sunny_talwar

Try this

Sum(Aggr(
If([PeriodoHasta] = Max(TOTAL <Oferta> {<[AtCompletion_Baja] = {'>0'}>} [PeriodoMovto]), [AtCompletion_Baja])
, [Oferta], [PeriodoHasta]))
AitorK
Contributor
Contributor
Author

Thanks for your reply, but it is returning 0 value.

sunny_talwar

Would you be able to share a sample to show the issue?