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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Ethel
Creator III
Creator III

Set analysis that excludes one parameter for one group only

Hello,

could you please help me with set analysis formula. 

I have two groups: "Faculty" and "Staff". Each group has subgroup "instructor"

I want to exclude subgroup "Instructor" only from group "Faculty".

I'm using this formula for a bar chart. I tried to exclude subgroup from dimension "Group", it didn't work for me.

This is my basic formula in measure

avg({<  TimeFrame = {'Current Year'}>}aggr(sum({< TimeFrame = {'Current Year'}>}[HeadCount]),[ID],Group))

 

Thank you very much in advance!

 

11 Replies
vinieme12
Champion III
Champion III

Hi @Ethel ,

you just need to replace [PeriodID]  with a field that identifies each record uniquely

 

example, if your data is as below, you need to use [RecID]  and not [PeriodID]

vinieme12_0-1666230855206.png

 

replace RecID with a field from your data set that identifies each record uniquely

avg({< $(vPeriodType), PeriodYear= {">=2019<=2023"}, TimeFrame = {'Current Year'},Gender={'F'}
,[RecID]=e({<Group={'Faculty'},SubGroup={'Instructor'}>}[RecID])
>}aggr(
sum({< $(vPeriodType), PeriodYear= {">=2019<=2023"},TimeFrame = {'Current Year'},Gender={'F'}
,[RecID]=e({<Group={'Faculty'},SubGroup={'Instructor'}>}[RecID])
>}[HeadCount])
,[PeriodID],Group))

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Ethel
Creator III
Creator III
Author

Thank you very much!