Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Running Total count Post Reply Post New Topic
Author Message
ashline
Newbie
Newbie


Joined: 22 May 2010
Online Status: Offline
Posts: 15
Quote ashline Replybullet Topic: Running Total count
    Posted: 06 Mar 2012 at 2:59pm
I am trying to create a running total count.
 
Here is my data
 
ID  Name      Account
1   MC1234   0000
2   MC1235   1233
3   MC1236   0000
 
So I create a running total and tell it to summerize on account
 
For evaluate I create the following formula
 
if account = '0000'
Then True
Else Flase
 
And I leave the reset to Never.
 
Well when I put the total into the report I only get 1.  And with the three records I would expect to get 2.
 
For this report I can not group all the reocrds by accounts and do an insert summary.  This report needs to be grouped differently.

Thanks for any help
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 07 Mar 2012 at 3:14am
I don't know about running totals much...DBlank loves them, and will probably chime in an appropriate solution.
 
I have seen when he wants to counts like this, he will create a formula like:
if account = '0000' then
  1
else
  0
 
then when he wants the count, he will sum up the formula as needed ie
sum( formula, group)  ...   or leave the group off if it is report wide.
 
HTH
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 07 Mar 2012 at 3:23am

I would create a Running total called Account0000 (maybe)

then in that set Field to Summarize as Id and Type of Summary as count.

Then I would Evaluate with Use a formula and in that

put {Account} = '0000'

 
I think what you are doing is re-setting your account formula every time, so it is only ever 1. If you had no 0000 it would return 0
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 07 Mar 2012 at 3:25am
... and I forgot, that if i was doing this, I would just use shared variables, incrementing them as needed and resetting when I deem it correct.
 
forgot that part...
shared variables is basically long hand for running totals
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Mar 2012 at 3:54am

An actual Running Total field (like variable formulas) must be placed on or below the location that has the rows being evaluated (e.g. details or footers).

Your post seems that you built the RT correctly but you did not totally describe it so I am not sure.
Your original post indicates to me that you are placing the RT in the report header. If you do that it only evaluates the first row in the report and will show a 1 (based on your sample data). If you move it tot he report (or group) footer it will evaluate all rows and show you the reult fromt that.
Your evaluation formula does not need an if-then only needs to be
table.account = '0000'
 
Lockwelles description of the formula for converting to a 1 or 0 is a uselful process if you do not have duplicates and you also want to use the insert sumamry function which allows for totals to be used in headers or group selection criteria.


Edited by DBlank - 07 Mar 2012 at 4:12am
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.