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

    Count the frequency of a distinct count

    rama.wong

      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]

       

      Selection_008.png

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

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

       

      Selection_009.png

      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?

       

      Many thanks for your inputs and advice!