Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Sheetal
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
trdandamudi
Master II
Master II

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
trdandamudi
Master II
Master II

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))

 

Sheetal
Contributor II
Contributor II
Author

Thank you. That worked. Appreciate your help.

Sheetal

 

trdandamudi
Master II
Master II

You are welcome and happy to hear that it worked.