Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gmmastros on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate Values being Calculated in my Running Total Formula

Status
Not open for further replies.
Mar 26, 2013
10
US
I have a report written in crystal 2008 off sql 2008 db.

Ideally, I will always want #1 and only #1.
Sometimes I need the #2 only when #1 is not present.
The problem is that there are records where #1 and #2 are both present. If thats the case, I only want #1.
Can this be done?
I appreciate any help you guys can give me.

Bud Actual Fiscal
1. 2013 2013 2013
2. 2012 2013 2012
 
Section Expert;details
add a formula to suppress current row if a record for the same thing already exists (you must already have something in common to know you don't need both records).
E.g.
if an employee is in two teams, but you only wanted to show one team per employee without grouping the report

the formula in suppress detail would be

fieldemployeenumber = previous(fieldemployeenumber)
Obviously, your report sort order matters as the second and subsequent matching records are suppressed.
 
oops, sorry forgot you were doing running totals.

you can have a formula field that only counts the the first instance in the group
@newfield
if group1,fieldemployeenumber = previous(group1,fieldemployeenumber) then 0 else fieldsalary
then sum or count the @newfield

If the data (fieldemployeenumber)can't be in more than one group, you don't need groupname references.
 
If you use Crystal's automatic logic for Running Totals, one option is to add just once per group.

The use of Crystal's automated totals is outlined at FAQ767-6524.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top