7 Replies Latest reply: Jul 13, 2015 5:53 AM by rgv rand

# 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 ?

• ###### Re: Count Exclude if any

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

• ###### Re: Count Exclude if any

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

• ###### Re: Count Exclude if any

Try this expression in your chart:

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

let me know

• ###### Re: Count Exclude if any

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

• ###### Re: Count Exclude if any

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

• ###### Re: Count Exclude if any

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

• ###### Re: Count Exclude if any

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