Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
msshawn3019
Contributor II
Contributor II

Combine two measures with conditions in AGGR function

This does not work

Aggr(RangeAvg([Debit SE Score],({<[Debit-IHC IND]={'1'}>} [Credit SE Score])), Segment)

I need to aggregate all [Debit SE Score] and only  [Credit SE Score] where [Debit-IHC IND] is true.  The value of the 2 measures should sum and display by "Segment"

These 2 lines of code work separately, but I need to combine the aggregated average

Aggr(Avg([Debit SE Score]), Segment)

Aggr(Avg({<[Debit-IHC IND]={'1'}>} [Credit SE Score]), Segment)

Labels (1)
1 Solution

Accepted Solutions
msshawn3019
Contributor II
Contributor II
Author

I've self-resolved this... hope it helps someone.  Place RangeAvg around the 2 Aggr functions.

RangeAvg(

Aggr(Avg({<[Debit-IHC IND]={'1'}>} [Credit SE Score]), Segment),

Aggr(Avg([Debit SE Score]), Segment))

View solution in original post

1 Reply
msshawn3019
Contributor II
Contributor II
Author

I've self-resolved this... hope it helps someone.  Place RangeAvg around the 2 Aggr functions.

RangeAvg(

Aggr(Avg({<[Debit-IHC IND]={'1'}>} [Credit SE Score]), Segment),

Aggr(Avg([Debit SE Score]), Segment))