Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
infock12
Creator III
Creator III

aggr if in set analysis

Hi all,

I would appreciate some help with getting the right result for the below expression. I have 3 dimensions Consultant, Fiscal Year, Site.

The two expressions I am trying are: In simple words, I want to sum(Activity) and count(Distinct (AttendanceDate)) with some exclusions

=if(Specialty='Supplies', sum({$<Consultant-={'Mr C Mithun', 'Collins', 'M James', 'R Carl', 'Mr M Smith'}>} Activity),

if(Specialty='Accounts', sum({$<Consultant-={'K Romel', 'Ian Wong', 'Hayden'}>} Activity),

sum({<{'YES/NO'='YES'}>}Activity))

=if(Specialty='Supplies', count({$<Consultant-={'Mr C Mithun', 'Collins', 'M James', 'R Carl', 'Mr M Smith'}>} DISTINCT (AttendanceDate)),

if(Specialty='Accounts', count({$<Consultant-={'K Romel', 'Ian Wong', 'Hayden'}>} DISTINCT (AttendanceDate)),

COUNT({<{'YES/NO'='YES'}>}, DISTINCT(AttendanceDate))

What these does is they remove the values and it gives a 0 value against the names but I want the names to be excluded from the pivot.

I tried aggr if(specialty-.....), Consultant, Fiscal Year, Site) as well but doesn't seem to work. Any help is appreciated.

Thanks,

Karthik

1 Solution

Accepted Solutions
PrashantSangle

Hi,

go to chart Property > presentation > tick supress zero values.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

4 Replies
PrashantSangle

Hi,

go to chart Property > presentation > tick supress zero values.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tunoi
Creator
Creator

If above proposal dont work then you can try:

sum({$<Consultant-={'Mr C Mithun', 'Collins', 'M James', 'R Carl', 'Mr M Smith'}, Specialty={'Supplies'}>} Activity)

+

sum({$<Consultant-={'K Romel', 'Ian Wong', 'Hayden'}, Specialty={'Accounts'}>} Activity)

+

sum({<{'YES/NO'='YES'}, Specialty-={'Accounts', 'Supplies'}>}Activity))

and the same modification for Count

infock12
Creator III
Creator III
Author

Thanks Prashant, that worked.

infock12
Creator III
Creator III
Author

Thanks Ionut, very helpful.