Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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?

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Multiple statements (AND) in set analysis

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
Highlighted
MVP & Luminary
MVP & Luminary

Re: Multiple statements (AND) in set analysis

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
Highlighted
Not applicable

Re: Multiple statements (AND) in set analysis

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