Suppress first record in group if a second one exists

OK, Here is the run down. I originally created the report expecting to only have 1 record.  I now have to modify the report to suppress the first record if the second one exists. The report is grouped by index number field. "ID" of which can be 1 or 2 records. I would like to only show the first record if the second one doesn't exist and suppress the first record if a second one exists.
I have sub reports that are grouped by the same ID field and are also showing two records at a time. Any suggestions ?


mowitAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HugoHiaslCommented:
you can use the NEXT() function to see if the next group_id value is the same as the actual. If it is then suppress the row.

Take care about the special cases OnFirstRecord and OnLastRecord.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
Will there be at most 2 records?

Can you put the information into the group footer?
That will print the LAST record in the group.

If you need it in the group header, then change the sort so the secod record is first.

mlmcc
0
mowitAuthor Commented:
mlmcc,
yes there will only be 2 records. In the sections that contained duplicate data i put the following:
If {SomeField.ProfIndex}<>next({SomeField.ProfIndex}) then
true
else
false
This will suppress the second record it turns out the data i need is only in the first record. I just have one remaining issue I need the value of a field and it keeps giving me the second record. The field is in a group footer. Its a formulated field of which I'm just concatenating a number and string.

i.e "{SomeField.Currency}&" "& {SomeField.TotAmt}"
0
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

mowitAuthor Commented:
Basically, how to I get the footer section to display the first record ?
0
mlmccCommented:
Put the concatenation in the group header then use a formula in the group footer to display.

Group header formula
WhilePrintingRecords;
Global StringVar strMyString;
strMyString := {SomeField.Currency}  &  " "  & {SomeField.TotAmt};
""

In the group footer
WhilePrintingRecords;
Global StringVar strMyString;
strMyString

mlmcc
0
mowitAuthor Commented:
Is there a way to completely ignore the first record throughout the entire report ?
0
mlmccCommented:
Even when there is only 1 record?

Not sure what you mean.  DO you have summaries that are off because they use all records?

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.