Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Conditional AGGR function

Hello

I am trying to use a condition on an AGGR function but not getting the desired output. I want to include the condition FY = PriorFY. This seems to work correctly on other expressions like SUM. For example in the simple expression below I get the desired result

Sum({<FY=PriorFY>}NumberAssisted)

However when I try to use it in an AGGR function, I am not getting the desired output.

The AGGR expression by itself works correctly , however when I add the FY=PriorFY it fails.

Sum(Aggr(Sum(DISTINCT servicehouramount), assistanceID)) -- This works as expected

Sum({<FY=PriorFY>}Aggr(Sum(DISTINCT servicehouramount), assistanceID)) -- Doesn't give the desired results. Am not sure how to write this expression. Can someone please assist.

Thanks in advance

Sheetal

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Master II
Master II

Re: Conditional AGGR function

Try one of the below works:

You must need an agregation expresion inside your AGGR()

Sum({<FY=PriorFY>} Aggr(Sum({<FY=PriorFY>} DISTINCT servicehouramount), assistanceID))

Sum({<FY={'PriorFY'}>} Aggr(Sum({<FY={'PriorFY'}>} DISTINCT servicehouramount), assistanceID))

 

View solution in original post

3 Replies
Highlighted
Master II
Master II

Re: Conditional AGGR function

Try one of the below works:

You must need an agregation expresion inside your AGGR()

Sum({<FY=PriorFY>} Aggr(Sum({<FY=PriorFY>} DISTINCT servicehouramount), assistanceID))

Sum({<FY={'PriorFY'}>} Aggr(Sum({<FY={'PriorFY'}>} DISTINCT servicehouramount), assistanceID))

 

View solution in original post

Highlighted
Contributor II
Contributor II

Re: Conditional AGGR function

Thank you. That worked. Appreciate your help.

Sheetal

 

Highlighted
Master II
Master II

Re: Conditional AGGR function

You are welcome and happy to hear that it worked.