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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
wttaryde
Contributor III
Contributor III

Set Expression in Aggr Measure

This expression works great. 

=Avg(
Aggr(
(Sum({1<[Question Alias]={"CT305A*","CT305B*"}>}Response)-sum({1<PermID={'6106totallcc','6106totallco'}>}Response))
/(Sum({1<[Question Alias]={"ST10*"}>}Response))
,CompName,Year)
)

But if I filter by CompName, then this expression filters anyway.  I tried putting a "1" after "Aggr" the software says the calculation is ok, but it also won't calculate a response.  So where does the 1 go in order to protect this calculation from filtering?

=Avg(
Aggr(1
(Sum({1<[Question Alias]={"CT305A*","CT305B*"}>}Response)-sum({1<PermID={'6106totallcc','6106totallco'}>}Response))
/(Sum({1<[Question Alias]={"ST10*"}>}Response))
,CompName,Year)
)

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Try this:
=Avg({1}
Aggr(
(Sum({1<[Question Alias]={"CT305A*","CT305B*"}>}Response)-sum({1<PermID={'6106totallcc','6106totallco'}>}Response))
/(Sum({1<[Question Alias]={"ST10*"}>}Response))
,CompName,Year)
)

View solution in original post

2 Replies
Lisa_P
Employee
Employee

Try this:
=Avg({1}
Aggr(
(Sum({1<[Question Alias]={"CT305A*","CT305B*"}>}Response)-sum({1<PermID={'6106totallcc','6106totallco'}>}Response))
/(Sum({1<[Question Alias]={"ST10*"}>}Response))
,CompName,Year)
)
wttaryde
Contributor III
Contributor III
Author

Thanks so much.  It's the little things that make me crazy.  I might have eventually gotten around to this but you saved me hours.