4 Replies Latest reply on Nov 21, 2018 4:23 AM by rama.wong

# Count the frequency of a distinct count

Hello! I have a data set as follows:

Person IDFruit
AApple
APear

B

Apple
CBanana
DBanana
DApple
DOrange
EOrange
EApple
FCoconut

I need to calculate the frequency of a person carrying multiple fruits. My goal is to have a table where:

Number of fruits chosen togetherNumber of occurrences (of people choosing such number of fruits together)
13
22
31

The way I approached this so far is:

Rows: COUNTD[Fruit] set as 'Discrete', untick Ignore Window Calculation

Detail: [PersonID]

How can I *count* the number of blocks seen over here?

I tried with WINDOW_COUNT(COUNT([Fruit])) set to Compute Using > Person ID

which gets me the right numbers, but in this weird format. How can I just get a table like this?

Number of fruits chosen togetherNumber of occurrences (of people choosing such number of fruits together)
13
22
31

Can you also share any pointers on how to identify which are the most frequent pairs within each group of multiple fruits?

• ###### 1. Re: Count the frequency of a distinct count

Like this ?

1 of 1 people found this helpful
• ###### 2. Re: Count the frequency of a distinct count

Absolutely! Thanks a lot!!

How can I identify which are the most frequent pairs within each group of multiple fruits?

i.e.: within the group "2 fruits" the most frequent fruit is "Apple", in association with "Pear" 50% times, and "Banana" 50% times.

Can you also share any pointers on this? I really appreciate if you can.

• ###### 3. Re: Count the frequency of a distinct count

Hi Rama,

I think you could apply an Basket Analysis which is explained here (without voice;)

Regards,

Norbert

1 of 1 people found this helpful