JetJack
JetJack

Reputation: 988

How to avoid the duplicate count

Using Crystal Report 7

ID Total

001 100
001 100
002 200
002 200
003 300
003 300

Formula for supressing the duplicate value

if {table1.ID} = previous({table1.ID}) then true else false

The above formula is working, but i want to sum of total value, when i use sum({table1.total}) = 1200, It should show 600 instead of 1200

Expected Output

ID Total

001 100
002 200
003 300
-------
    600

How to get a exact total.

Need Crystal report formula help or suggestion

Upvotes: 0

Views: 2681

Answers (1)

Lee Tickett
Lee Tickett

Reputation: 6027

You should really address the underlying issue. Why are the rows being duplicated? I suspect there are additional columns you haven't shown us.

Alternatively you can:

  • Group by ID, then use a running total set to evaluate on change of group
  • Use a running total set to evaluate using the opposite condition to your suppression formula {table1.ID} <> previous({table1.ID})

P.S. You can write if {table1.ID} = previous({table1.ID}) then true else false as {table1.ID} = previous({table1.ID})

Upvotes: 3

Related Questions