Link to home
Start Free TrialLog in
Avatar of Brandon
BrandonFlag for United States of America

asked on

record suppression based on previous record

Ok I have a fairly complex suppression issue Im trying to sort thru and I found a partial answer in another post which is this..

(not OnLastRecord and next({@Status}) = {@Status})           //Suppresses the record if the next matches
OR
(not (onfirstrecord) and previous({@Status}) = {@Status})   //Suppresses the record if the previous matches

Ok so I have three conditions and let me see if I can explain what im trying to do..
up to three records per customer - which can be record type 53 2788 and 15821

I want suppress all 53's if the following record is 2788 (I want to keep all 53's if the following record isnt 2788)
I want supress all 53's if the following record is 2788 and the one after that is 15821, as well is the 2788s and the 15821s that follow the 53's

make sense?
Avatar of Mike McCracken
Mike McCracken

IN the section(record) suppression formula try

(not OnLastRecord and {RecordType} = 53 AND Next({RecordType}) = 2788)
OR
(Not OnFirstRecord AND Not OnLastRecord AND Previous({RecordType}) = 53 AND {RecordType} = 2788 AND Next({RecordType}) = 15821)

Can you have a 2788 that doesn't follow a 53?

mlmcc
Avatar of Brandon

ASKER

Its doing the first part but not the second.. the following  2788 and 15821 arent suppressing after the 53..


and no I dont believe there will be a case where a 2788 doesnt follow a 52
I asked that because you can only look back 1 record.

Do you want the 2788 suppressed if it is after a 53 or only if it is after 53 and followed by 15821?

mlmcc
Avatar of Brandon

ASKER

if its in this order then
53
2788
15821

then suppress all three
Try

(not OnLastRecord and {RecordType} = 53 AND Next({RecordType}) = 2788)
OR
(Not OnFirstRecord AND Not OnLastRecord AND Previous({RecordType}) = 53 AND {RecordType} = 2788 AND Next({RecordType}) = 15821)
OR
(Not OnFirstRecord AND Previous({RecordType}) = 2788 AND {RecordType} = 15821)

mlmcc
Avatar of Brandon

ASKER

no difference
the trailnig 2788 and 15821 still show
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Brandon

ASKER

same thing
Can you upload the report

mlmcc
Avatar of Brandon

ASKER

no sir. proprietary data / fields.  

I think I just found a work around... I added
or if {field} = 156251 or {field} = 2788
then true

which I realized I didnt need thise records after your supprerssion.  cake. :)