Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Multiple statements (AND) in set analysis

I'm trying to chain the following together...

=Count(DISTINCT{$<

UniqueKey = {"=([Role Geographic Unit]=GeographicUnitDesc)" },

UniqueKey = {"=([Role Country]=CountryNm)" },

UniqueKey = {"=([Role Metro City]=MetroCityDesc)" },

UniqueKey = {"=([Role Level From Group]=HRResourceLevelGroup)" },

UniqueKey = {"=([Role Career Track]=ResourceCareerTrack)" },

UniqueKey = {"=([Role Talent Segment]=ResourceTalentSegment)" }

>}PeopleKey)

UniqueKey was generated using AutoNumber().  This would be a field to field comparison across 10 fields so each one is a field and not a static value.  The total always evaluates to the last statement though (UniqueKey = {"=([Role Talent Segment]=ResourceTalentSegment)" }) and I need it to evaluate across all 5.  In other words, give me the number of records where FieldA=Field1 AND FieldB=Field2 AND FieldC=Field3, etc.

Thoughts?

1 Solution

Accepted Solutions
Not applicable
Author

The correct approach is the following ...

=Count(DISTINCT{$<

UniqueKey1 = {"=([Role Geographic Unit]=GeographicUnitDesc)" },

UniqueKey2 = {"=([Role Country]=CountryNm)" },

UniqueKey3 = {"=([Role Metro City]=MetroCityDesc)" },

UniqueKey4 = {"=([Role Level From Group]=HRResourceLevelGroup)" },

UniqueKey5 = {"=([Role Career Track]=ResourceCareerTrack)" },

UniqueKey6 = {"=([Role Talent Segment]=ResourceTalentSegment)" }

>}PeopleKey)

Can't use the same field (UniqueKey) for the boolean value.

View solution in original post

2 Replies
Gysbert_Wassenaar

Maybe this:

=Count({$<

UniqueKey = {"=[Role Geographic Unit]=GeographicUnitDesc  and

[Role Country]=CountryNm and

[Role Metro City]=MetroCityDesc and

[Role Level From Group]=HRResourceLevelGroup  and

[Role Career Track]=ResourceCareerTrack  and

[Role Talent Segment]=ResourceTalentSegment" }

>} DISTINCT PeopleKey)


talk is cheap, supply exceeds demand
Not applicable
Author

The correct approach is the following ...

=Count(DISTINCT{$<

UniqueKey1 = {"=([Role Geographic Unit]=GeographicUnitDesc)" },

UniqueKey2 = {"=([Role Country]=CountryNm)" },

UniqueKey3 = {"=([Role Metro City]=MetroCityDesc)" },

UniqueKey4 = {"=([Role Level From Group]=HRResourceLevelGroup)" },

UniqueKey5 = {"=([Role Career Track]=ResourceCareerTrack)" },

UniqueKey6 = {"=([Role Talent Segment]=ResourceTalentSegment)" }

>}PeopleKey)

Can't use the same field (UniqueKey) for the boolean value.