New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Get Total Sum from conditional SUM

Hello there:

I have an Straight Table and I need to replicate sum Totals for each month selected, something like when May is selected:

In my Qlikview file shows the information like:

When I hide the Column AñoNombreMes, the result is different from the sum of values

Here is my expression:

=if

Sum({<EscenarioT={'REAL'},AñoT={'\$(vMaxAño)'},Mes_Num={'>=1 <=\$(vMaxMesNum)'},Mes=,MesT=,Total_MedidaT={'=not isnull(Total_MedidaT)'}>} Datos)

*

Count({<Año={'\$(vMaxAño)'},Mes=,MesT>} DISTINCT(FechaCont))

)

I Wonder if it is possible to get the Total sum from the conditional SUM or change the expression in order to get the correct sum of values.

My best regards.

Tags (4)
1 Solution

Accepted Solutions
Partner

Re: Get Total Sum from conditional SUM

HI,

Try This

aggr(
Sum({<MesT=,Mes, Codigo_IndicadorT={'PROFIT'}, EscenarioT={'REAL'},AñoT={'\$(vMaxAño)'},Mes_Num={'>=1 <=\$(vMaxMesNum)'},Mes=,MesT=,Total_MedidaT={'=not isnull(Total_MedidaT)'}>} Datos)
*
,
[AñoNombreMes])
)

-Sathish

4 Replies
MVP

Re: Get Total Sum from conditional SUM

Maybe using advanced aggregation, something like

=Sum({<EscenarioT={'REAL'},AñoT={'\$(vMaxAño)'},Mes_Num={'>=1 <=\$(vMaxMesNum)'},Mes=,MesT=,Total_MedidaT={'=not isnull(Total_MedidaT)'}>}
Aggr(
if
//Aggr(
Sum({<EscenarioT={'REAL'},AñoT={'\$(vMaxAño)'},Mes_Num={'>=1 <=\$(vMaxMesNum)'},Mes=,MesT=,Total_MedidaT={'=not isnull(Total_MedidaT)'}>} Datos)
*
Count({<Año={'\$(vMaxAño)'},Mes=,MesT>} DISTINCT(FechaCont))
)
,[AñoNombreMes]))

Partner

Re: Get Total Sum from conditional SUM

HI,

Try This

aggr(
Sum({<MesT=,Mes, Codigo_IndicadorT={'PROFIT'}, EscenarioT={'REAL'},AñoT={'\$(vMaxAño)'},Mes_Num={'>=1 <=\$(vMaxMesNum)'},Mes=,MesT=,Total_MedidaT={'=not isnull(Total_MedidaT)'}>} Datos)
*
,
[AñoNombreMes])
)

-Sathish

Not applicable

Re: Get Total Sum from conditional SUM

Thank you Sathish G, it works perfect.

My best regards.

Not applicable

Re: Get Total Sum from conditional SUM

Thank you for you time swuehl, it works, nevertheless when I unmark PROFIT the column doesn't show values.