# 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
Did you mean:
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:

 Org MemberCount A 15 B 35 C 24

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

 Org MemberCount MaxMemberCount A 15 35 B 35 35 C 24 35

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

Labels (4)

• ### Max()

1 Solution

Accepted Solutions
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

7 Replies
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

Contributor II
Author

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

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

 Org MemberCount MaxMemberCount A 15 74 B 35 74 C 24 74

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

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.

MVP

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

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))

MVP

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

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))