Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to use aggr function inside sum expression


I'm facing a problem on an expression. I need to verify if there is only one month selected or not. I have a pivot table and an expression like this one:

If(Sum(Quantity) =0 ,'', // Here I'm sure the dimension will show even there is no Quantity


    If(not Match(Function,'A','=') ,iF(ISNULL(Quantity),0,Quantity),

        If(((Month=1) or ((aggr(Count(distinct Month), Year, LineCode))=1)) and Function='A',Quantity,

            If((Month=12 or (aggr(Count(distinct Month), Year, LineCode))=1) and Function='=', Quantity,






I'm not getting the expect result. This (aggr(Count(distinct Month), Year, LineCode)) does not work when used in the above expression but, if I use just it as another expression, the result is OK.

Does anybody can help me?

2 Replies
Honored Contributor II

Re: How to use aggr function inside sum expression

Can you share the Application ??

Not applicable

Re: Re: How to use aggr function inside sum expression

Sure. Thanks.

Community Browser