Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count Exclude if any

Hi guys,

Got confused in some calculation.

Doc No.      Item         Qty     Customer

INV-01          A             2           ALPHA

INV-01          B             1            ALPHA

INV-02          B              2           DELTA

INV-03          A              1            OMEGA

i want to count how many customer that bought ITEM "B" only. so the correct answer should be "1"

can anybody help ?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

=SUM(Aggr(IF(Count({<Item = {'B'}>}DISTINCT Item)=1 and COUNT(DISTINCT Item)=1,1),Customer,[Doc No]))

Set Analysis

=COUNT({<[Doc No] = {"=Count({<Item = {'B'}>}Distinct Item)=1"}>*<[Doc No] = {"=Count(Distinct(Item))=1"}>}DISTINCT Customer)

View solution in original post

7 Replies
MK_QSL
MVP
MVP

=SUM(Aggr(IF(Count({<Item = {'B'}>}DISTINCT Item)=1 and COUNT(DISTINCT Item)=1,1),Customer,[Doc No]))

Set Analysis

=COUNT({<[Doc No] = {"=Count({<Item = {'B'}>}Distinct Item)=1"}>*<[Doc No] = {"=Count(Distinct(Item))=1"}>}DISTINCT Customer)

alexandros17
Partner - Champion III
Partner - Champion III

Try this expression in your chart:

Sum({$ <Item={'B'}>} If(Aggr(NODISTINCT Count(Item), Customer)=1,1,0))

let me know

antoniotiman
Master III
Master III

=Count({<Customer={"=Only(Item)='B'"}>} DISTINCT Customer)

Not applicable
Author

Thanks Manish, i'm using your Set Analysis and it worked

Not applicable
Author

Thanks Alessandro, but the result was wrong in my file.

Not applicable
Author

Thanks Antonio , but didn;t show the correct answer.

Anonymous
Not applicable
Author

=Count({<Item= {'B'}>}Customer)