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

Count if

edited June 2006 in General
?Hi all,
I am kind of new to this so you will have to bear with me. I have a long
list of records on a report. Next to each record is a dealership field
that holds the dealer name. How would i go about counting records that
have the dealer name of 'Thrifty Birmingham'. I know that you can use the
POS command to count were a specific character is in a string but was
wondering if there is a similar technique for a whole string. Hope this
makes sense.

Many Thanks
Dave



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited June 2006
    Hi Dave,

    If for instance you would like to show this value inside the footer or
    summary band of your report, you could place a TppVariable inside this band
    and in its OnCalc event, check the Dealership record value and increase its
    value if the dealership is a specific one. The code below is for a static
    dealership but it could easily be changed to handle user input.

    begin

    lsDealership := ppReport.DataPipeline['Dealership'];

    if lsDealership = 'Thrifty Brimingham' then
    Value := Value + 1;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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