Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
francisvandergr
Partner - Creator II
Partner - Creator II

Count and distinct with conditions

I have a question. I include an example of what i want. I try to explain it also here. I have a dimension group on my dashboard. In the expression i have a count of debno. But it may only count if the debno is not in another group. The debno's who are in more groups must be named in the group "Multiple".

Is this possible with qlikview ?

1 Solution

Accepted Solutions
Not applicable

I think yes.

See attached, or apply the following expression in your "table 2"

sum(aggr(if(count(DISTINCT Group)=1,1,0),Debno))

That expression will per group, count only those DebNo's where they are only in 1 group.

I think, in the same chart you cannot add "multiple" as a line...

A solution can be to place a textbox somewhere, where the "multiple" value is calculated.

This is the expression for the textbox to calculate the "multiple group debo's"

sum(aggr(if(count(DISTINCT Group)>1,1,0),Debno))

See attached QVW where I applied those formula's.

Hope it helps.

View solution in original post

3 Replies
Not applicable

I think yes.

See attached, or apply the following expression in your "table 2"

sum(aggr(if(count(DISTINCT Group)=1,1,0),Debno))

That expression will per group, count only those DebNo's where they are only in 1 group.

I think, in the same chart you cannot add "multiple" as a line...

A solution can be to place a textbox somewhere, where the "multiple" value is calculated.

This is the expression for the textbox to calculate the "multiple group debo's"

sum(aggr(if(count(DISTINCT Group)>1,1,0),Debno))

See attached QVW where I applied those formula's.

Hope it helps.

francisvandergr
Partner - Creator II
Partner - Creator II
Author

Thnx this is what i mean!

Not applicable

You're welcome!

Happy Qlikviewing!