Count if
?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
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
This discussion has been closed.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com