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?
 
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
 
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.