Crystal Report Crosstab Calculations

MISMajorDeveloperAnyways picture MISMajorDeveloperAnyways · Apr 17, 2013 · Viewed 7k times · Source

In my crosstab, I am trying to add a summarized field that will take two other summarized fields and create a percentage based off of those.

One field totals all of the appointments for a provider (count of appt), while the other one totals the number of possible sales opportunities (sum of opp). What I am trying to add is a summarized field that is esentially opp/appt in percentage form.

How would I go about doing this?

             Week 1 | Week 2 | Week 3 | Week 4|
Provider A          |        |        |       |
    Appts       3   |    3   |   4    |   1   |
    Opps        1   |    2   |   1    |   1   |
 Opps/Appts     ??  |   ??   |  ??    |   ??  |

Answer

craig picture craig · Apr 18, 2013

In Crystal Reports 2008:

  • Select 'Opps' calculation field; choose Embedded Summary, then Insert Embedded Summary
  • Select newly-created embedded-summary field; right click; choose Embedded Summary, then Edit Calculation Formula
  • Add the following text:

    Local Numbervar Denominator:=GridValueAt (CurrentRowIndex, CurrentColumnIndex, 0); Local Numbervar Numerator:=GridValueAt (CurrentRowIndex, CurrentColumnIndex, 1);

    If Denominator<>0 Then Numerator/Denominator * 100;