Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Running Total Post Reply Post New Topic
Author Message
danboy
Newbie
Newbie
Avatar

Joined: 26 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote danboy Replybullet Topic: Running Total
     Posted: 18 Feb 2013 at 12:59am
Hi
 
I know we can use running totals to summarise and place results in the report footer, say I want to work out the number of waiting tickets like this:
 
IF {Incident.Status} = "Waiting" Then Count ({LastAssignment.ParentNumber})
 
If I wanted to add this to the page header it would come us as 0 records.
So, I create a running total called #Waiting like this:
 
Filed to summarize = Incident.Status
Type of Summary = Count
Evaluate using a formula which = Incident.Status = "Waiting"
 
I would then place this in the Rerport Footer and bingo I have my correct result!!
 
I can then add this in the report footer to work out the percentage
 
{#Waiting}/Count({LastAssignment.ParentNumber})*100 //percent of waiting
 
but how do we add a formula to enable us to insert the result anywhere on the report, like the header??? without using a running total??
 
Thanks
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 18 Feb 2013 at 6:16pm
hi

You change your Waiting formula like :

if {Incident.Status} = "Waiting" Then 1 else 0

Place this on your detail / group wherever you have incident.status field.

Now right click on that formula and insert--summary--and select Grand Total

It will display a grand total on your report footer, you can drag that to report header.. not on page header



Thanks,
Sastry
IP IP Logged
danboy
Newbie
Newbie
Avatar

Joined: 26 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote danboy Replybullet Posted: 18 Feb 2013 at 10:42pm
H9i
 
thats really handy I can use that tip elsewhere now instead of using running totals...I've also set the non waiting calls so I have both summarys in the header...how can I calculate the percentage now of the waiting and the non waiting...
 
If {Incident.Status} = "Waiting" Then 1 else 0
If {Incident.Status} <> "Waiting" Then 1 else 0
so waiting/non waiting *100
 
to also place in header, I tried this but it comes up as 0.
 
Thanks
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 19 Feb 2013 at 12:28am
HI

Is these two statements in one formula or in different formulas ?

create one formula with each statement and insert a sum on this formula then you will get total 'waiting' or <> 'waiting'


Thanks,
Sastry
IP IP Logged
danboy
Newbie
Newbie
Avatar

Joined: 26 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote danboy Replybullet Posted: 19 Feb 2013 at 12:54am
the y are 2 seperate formulas and they both give me the correct result...one formula?
 
can you show this please?
 
I need to work out the percentage of each?
 
If {Incident.Status} = "Waiting" Then 1 else 0 else
If {Incident.Status} <> "Waiting" Then 1 else 0
 
Thanks
IP IP Logged
danboy
Newbie
Newbie
Avatar

Joined: 26 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote danboy Replybullet Posted: 19 Feb 2013 at 3:07am
Hi
 
not sure how to do this, I've tried a few ways but no luck...the totals are correct just need the percentage?
 
Can you help?
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Feb 2013 at 3:50am
your percentage formula should be using the sum for each formula
 
sum(@waiting)%sum(@non waiting)
IP IP Logged
danboy
Newbie
Newbie
Avatar

Joined: 26 Nov 2012
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote danboy Replybullet Posted: 19 Feb 2013 at 4:28am
Hi Yea
 
I sorted it by creating 2 seperate formulas with:
 
Sum({@Total Waiting})
Sum({@Total Non Waiting})
 
and then created a percent formula to work out the pecentage that works in the header.
 
 
So 2 formulas to calculate totals then used these to work out percentage,
If {Incident.Status} = "Waiting" Then 1 else 0
If {Incident.Status} <> "Waiting" Then 1 else 0
 
I find it a bug bear that you cant add to the header with out formulas like this, running totals do the same job but they sit in the report footer.
Thanks for your help
Much appreciated
Dan
IP IP Logged
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