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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summarizing amounts that have duplicates suppressed 1

Status
Not open for further replies.

77walker

Technical User
Feb 7, 2008
33
US
I am running Crystal 9 and I have a formula that suppresses duplicate records, however when I insert a summary I am still getting the dollars associated to those suppressed records in my total. How do I eliminate those monies out? I am doing the suppression in the Section Expert at the detail level. Any help would be appreciated.

Thank you,

77walker
 
Insert a running total that uses a formula in the evaluation section. The formula should be the opposite of your suppression criteria.

-LB
 
LB-

your suggestion worked ok, but it eliminates not only the suppressed record but also the one that I really want displayed. Is it because of my suppression formula?

my suppression formula looks like this:

if previous ({O_AR_PAYMENTS.ITEM})={O_AR_PAYMENTS.ITEM} and
previous({O_AR_PAYMENTS.ITEM_LINE}) = {O_AR_PAYMENTS.ITEM_LINE} then
true
else
false;

It eliminates just the one record from the report but eliminates both totals from the running total.
 
You supression formula only prevents the data from being displayed on screen.

The problem would be with the running total formula or how it is configured. For the formula it should be opposite as lbass mentioned so something like:

not(previous ({O_AR_PAYMENTS.ITEM})={O_AR_PAYMENTS.ITEM} and
previous({O_AR_PAYMENTS.ITEM_LINE}) = {O_AR_PAYMENTS.ITEM_LINE})
 
You should NOT add a check mark when adding a conditional formula for suppression in the section expert or you will lose the first record of the display. Since there is no previous record for the first record, the suppression formula does not execute and instead defaults to the condition in the checkbox.

The running total would have no impact on the display however. I would use a formula like this:

onfirstrecord or
(
{O_AR_PAYMENTS.ITEM} <> previous ({O_AR_PAYMENTS.ITEM}) or
{O_AR_PAYMENTS.ITEM_LINE} <> previous({O_AR_PAYMENTS.ITEM_LINE})
)

-LB
 
HI. Just looking through your post. I have a STUPID question that I cant find in a book. Does ONFIRSTRECORD apply to the total EXTRACTED file OR to the first record in EACH GROUP ? THANKS
 
what I found in my book is:

ONFIRSTRECORD Returns a T/F value indicating if the current record is the first record on the report. It's usually used for some conditional formatting requirement.
 
Onfirstrecord is just the first record in the report. If you need to test whether the record is the first in the group, you would use the previous function, as in:

(
onfirstrecord or
{table.groupfield} <> previous({table.groupfield})
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top