Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to be able to have a paired bar chart where 1 bar can be filtered by year BUT is always the average for all responses. The other bar can be filtered by year and is specific company response. Currently my expressions are;
Group Average: = avg ( distinct {1<QPermID={"AM0425_R*"}>} Response)
Company Response: = MAX( distinct {$<QPermID={"AM0425_R*"}>} Response)
If I want to change the year, the Company Response responds as expected. I can filter by a specific company and a specific year. However, with a set expression of '1', my Group Response doesn't change.
In other expression in my app, I use the orange expression below. This allows the Group response to always be the max year and it will also change to whatever is the max year that I've selected in my filter...
=(Avg({1<Year = {$(=Max(num#(Year ,'####')))}>} Aggr(Sum({1<QPermID={"AM0425_R_1*"}>}Response),YearID,Year)))
I have tried placing {1<Year = {$(=Max(num#(Year ,'####')))}>} into my group and company responses for the paired bar, but they are ignored. The expression isn't broken, it just doesn't get applied. That means my Group Average is always inclusive of all years of data.
In my example App,
I'm open to a whole new expression as long as it gets me what I need. Thanks
try this
=sum( {<QPermID={"AM0425_R*"},Response={">0"},Year = {$(=Max(num#(Year ,'####',)))}>} Response)/
Count({<QPermID={"AM0425_R*"},Response={">0"},Year = {$(=Max(num#(Year ,'####',)))}>} CompID)
You are my hero. That worked. I have 15 different versions of this chart that now all work as expected. Thank you.
Glad that it worked
I also appreciate the elegance of your expression. I'll be adopting that format for future expressions.