Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Conditional summaries? Post Reply Post New Topic
Author Message
andrew
Newbie
Newbie
Avatar

Joined: 11 Nov 2008
Location: United Kingdom
Online Status: Offline
Posts: 35
Quote andrew Replybullet Topic: Conditional summaries?
    Posted: 14 Sep 2009 at 8:28am
Hi all,

I've got a report that predicts revenue generated from room bookings. the report lists all pencilled (up to 6 pencils) & confirmed bookings between a defined date range (say a week).

I'd now like to get it so it comes up with totals depending on the type of booking.

For example:

Room A
pencil 1 - $200
Pencil 2 - $150
Confirmed - $195

Totals:
Pencils: - $350
Confirmed - $195

Now, the summary by default will just total everything - but i was wondering if I can have it where I can do something like a record selection/ formula.

Can i do this? or does it require a seperate group or sub report?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Sep 2009 at 8:55am
You can do this in several ways. For this I am guessing each row has a "Type" field that uses the values of "Pencil1, Pencil 2, ..., Confirmed" and an amount field that is used for the dollar amounts regardless of the type....
 
1. Make 2 if then formula fields that give you the values based on the "type" and then sum each of those formula fields.
e.g.
formula "Pencil" as
if table.typefield<>"Confirmed" then table.amountfield else 0
formula "Confirmed" as
if table.typefield="Confirmed" then table.amountfield else 0
Do a Sum at group level on each formula.
2. Create variable formulas for each
3. use Running Totals (with conditional record inclusion)
You will need 2 for the group level and 2 for the report footer level if you want that displayed also.
Post if you want/need help with either option 2 or 3.


Edited by DBlank - 14 Sep 2009 at 8:56am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.