Search code examples
crystal-reports

Display only records exceeding four items


My Group Footer shows the number of distinct items bought by each customer:

Cust Ref,      Items bought (distinct count)

001,            4
002,           12
003,           6 
004,           3

How can I display only the customers who have bought 5 or more distinct items? I tried using distinctcount(items bought) > 4 but it looks at all the distinct items bought by everyone, not each individual customer. What formula should I use and where?


Solution

  • You have to place a group by CustRef, then at the footer place the CustRef and a formula named @DistCnt containing (DistinctCount({ItemsBoughts})) (It seems you've already done that)!

    Then in the Section Expert section click on the (x-2) button near the suppress checkbox related to this group footer and write: @DistCnt < 5 and save.