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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr Problem with more than one month

Hi Dear Community

I Have a vertical bar graph with a Time Cyclic Group Dimension Called "Tiempo" ("Año" (Year),"Semestre" (Semester),"Trimestre" (Quarter) and "Mes" (Month)) the expression is

Sum(TOTAL AGGR(Sum(DISTINCT{<[Codigo Cuenta PUC Gastos]={'522010','512010','732010'}, [Nombre Tipo Unidad de Negocio]={'Cadena'}>}

    If(Match(Mid([Nombre Centro de Costo],1,8),'Regional')>0,[Valor Gastos])),Año,Semestre,Trimestre,Mes))

The value of expression is correct when i select one month, but when i have two or more months the result is diferent, i don't know what's the problem.

Thanks for some idea

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Not sure why you need a nested sum here. Have you tried:

Sum({<[Codigo Cuenta PUC Gastos]={'522010','512010','732010'}, [Nombre Tipo Unidad de Negocio]={'Cadena'},

[Nombre Centro de Costo] = {"*Regional*"}>} DISTINCT [Valor Gastos])

I don't know if this correct for your problem, but if you need the nested sum, have you tried:

Sum(TOTAL AGGR(Sum({<[Codigo Cuenta PUC Gastos]={'522010','512010','732010'}, [Nombre Tipo Unidad de Negocio]={'Cadena'},

[Nombre Centro de Costo] = {"*Regional*"}>} DISTINCT [Valor Gastos])),Año,Semestre,Trimestre,Mes))

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Not sure why you need a nested sum here. Have you tried:

Sum({<[Codigo Cuenta PUC Gastos]={'522010','512010','732010'}, [Nombre Tipo Unidad de Negocio]={'Cadena'},

[Nombre Centro de Costo] = {"*Regional*"}>} DISTINCT [Valor Gastos])

I don't know if this correct for your problem, but if you need the nested sum, have you tried:

Sum(TOTAL AGGR(Sum({<[Codigo Cuenta PUC Gastos]={'522010','512010','732010'}, [Nombre Tipo Unidad de Negocio]={'Cadena'},

[Nombre Centro de Costo] = {"*Regional*"}>} DISTINCT [Valor Gastos])),Año,Semestre,Trimestre,Mes))

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

The expression  is

Sum(TOTAL AGGR(Sum(DISTINCT {<[Codigo Cuenta PUC Gastos]={'523535','513535','733535'}, [Nombre Tipo Unidad de Negocio]={'Cadena'}>} 

               If(Match(Mid([Nombre Centro de Costo],1,8),'Gerencia')>0,

               If(Match([Nombre Zona],'Gerencia Administrativa Financiera')=0,

                              [Valor Gastos],0))),Año,Semestre,Trimestre,Mes))

Sorry in the original post is wrong please refeer to this post

Not applicable
Author

I tried this option and was correct thanks