Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
McLaughlinMatt
Contributor II
Contributor II

Max count across a single dimension

This is driving me crazy. I have a straight table with  Orgs as the dimension and Count(Distinct MemberID) as the first expression:

OrgMemberCount
A15
B35
C24

 

What I want is another column for the Max MemberCount across the whole table like this:

OrgMemberCountMaxMemberCount
A1535
B3535
C2435

 

This seems like it should be incredibly simple but it's defeated me for hours.

Labels (4)
1 Solution

Accepted Solutions
Kush
MVP
MVP

If Member count is direct field you can use below

Max(total MemberCount)

If Member count is your expression then use below

Max(total aggr(Count(distinct MembeID), Org)) ----> Assuming  Count(distinct MembeID)  is MemberCount expression

 

View solution in original post

7 Replies
Kush
MVP
MVP

If Member count is direct field you can use below

Max(total MemberCount)

If Member count is your expression then use below

Max(total aggr(Count(distinct MembeID), Org)) ----> Assuming  Count(distinct MembeID)  is MemberCount expression

 

View solution in original post

McLaughlinMatt
Contributor II
Contributor II
Author

I've tried that and it doesn't work.

Max(total aggr(Count(distinct MemberID), Org)) gives me:

OrgMemberCountMaxMemberCount
A1574
B3574
C2474

 

The TOTAL seems to be totaling the aggregation before I take the Max...

McLaughlinMatt
Contributor II
Contributor II
Author

OK. I figured out what's happening. There are memberIDs with NULL in the Org field due to a wonky join. So I wasn't seeing them in the dimension. Need to fix the join and then it will work as promised.

Kush
MVP
MVP

What is the membercount expression? I have assumed the expression. You can use your actual expression It will work

McLaughlinMatt
Contributor II
Contributor II
Author

This is what worked because it handled the null case correctly. NOTE the minus equals

Max(total aggr(Count({$<Org-={'*'}>}distinct MemberID), Org))

Kush
MVP
MVP

You don't need that. You can use suppress null value option if Org is null for Member IDs.

Kush
MVP
MVP

If you have NULL values then you need to use which you are using or blow

max(total aggr(Count({1-$<Org={'*'}>}ID),Org))