Even if a value of Agency_Code is selected, I want the formula above to evaluate for all values of Agency_Code and matching other conditions mentioned in the statement.
Basically I want {1}Agency_Code but this does not work in the aggr function.
The function aggr() will return a "temp" table according to the selections made (the user state)
If you want a table with all Agency_Code, I think you will need to use a avg or sum({set analysis} aggr() )
If you want to complete the set analysis with all the agency codes according to a test (one single value selected), you need to populate a variable (as a formula) that will be either nothing or ', Agncy_Code= ' so that you can do $(thisvariable) into your set