Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Count Unique Values

edited June 2003 in General
Is there any (easy) way to count unique values
in a report. For example, suppose I have an
order report grouped by price range. I would
like to have a count of unique customers Ids
per group as well as for the entire report
(note that a customer can show up in more
than one price group). Thanks.

Comments

  • edited July 2003
    Hi John,

    There are two ways you could do this. The easiest way would be to create
    another dataset that counts each distinct customer id, and link it to your
    existing dataset for use within your report. If you wish to perform this
    task inside Delphi and ReportBuilder, you would need to create a count
    variable and keep track of each unique customer ID in a list object such as
    a TList or TStringList. Then you could loop through these values, count the
    unique ones and group by that in your report.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.