Skip to Content

Crystal Reports 2013 - Calculation in Cross Tab

I have a report where I have two numbers in each cell of a cross tab, and I need to get a third by dividing one of the numbers by the other. I am displaying room revenue and occupied rooms, and I need to calculate the third field to get Average Daily Rate.

I did try creating an actual ADR field in the report wherein I divide

sum({fdroomstat.room_revenue})/sum({@Rooms Occupied})

But then when I add it to Summarized Fields I am forced to use an aggregation so I use AVG... I thought that worked fine for each individual cell but I have just realized that's not even the case.

In any case, when you get to row and column totals, instead of adding all the revenue and dividing by all the rooms occupied, you get a random number that is meaningless.

What am I missing? I am certain this is simple but I just cannot see how to do it.

Any help would be much appreciated! Thank you.

dwta9.png (3.1 kB)
znzu5.png (3.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 07, 2018 at 08:08 AM

    Hi Rayna,

    Try this please:

    1. Right-click the second summary cell > Embedded Summary > Insert Embedded Summary.

    2. A blank cell with the text "Edit this formula" will be inserted.

    3. Right-click this new cell > Embedded Summary > Edit Calculation Formula > Use this code:

    GridValueAt(CurrentRowIndex, CurrentColumnIndex, 1) / GridValueAt(CurrentRowIndex, CurrentColumnIndex, 0)


    Add comment
    10|10000 characters needed characters exceeded