nomen
nomen

Reputation: 3715

Crystal Reports 2013: Filter shown records

I have a report with the following structure:

<sales person>
  <appointment date>
  <appointment status>

Now, the appointment status can be either 'kept', 'cancelled by customer', or 'cancelled by sales person' (for simplicity). I want to calculate the percentage that were cancelled. To calculate that, I will need to select all of the appointments, and divide the number that was not kept by the total number. Okay, I get that.

Now, the trouble is that I also want to show the appointments that were cancelled in my report, and exclude the appointments that were kept. In other words, I pretty much just want to skip printing these irrelevant records. How can I accomplish this?

Upvotes: 0

Views: 69

Answers (1)

CoSpringsGuy
CoSpringsGuy

Reputation: 1645

formula1

If {<appointment status>} = "kept" then 1 else 0

That will give you a count which you can use to get your percentage for sales person.

   if sum({@formula1},{<sales person>}) > 0 
    then sum({@formula1},{<sales person>}) % count({<appointment status>} ,{<sales person>})
    else 0

Then suppress the details with a formula like this

{@formula1} = 1

Upvotes: 1

Related Questions