Link to home
Start Free TrialLog in
Avatar of b612_forever
b612_forever

asked on

"Supress if duplicated" based on combination of more than 1 fields

I am new to CrystalReport and recently I faced a problem in using "Supress if duplicated".

The default "supress if duplicated" is based on data of the field u select, it is based on just one fields. But now i am required to do the "supress if duplicated" based on data in more than one fields, for example, when I implement "supress if duplicated" on Transaction Date, I get the following:

Customer Name     Transaction Date              Item
===============================================
John                       20/04/2005                    item A
John                                                            item B
John                       21/04/2005                    item C
John                                                            item D

When I implement "supress if duplicated" on both Customer Name and Transaction Date, I get this:

Customer Name     Transaction Date              Item
===============================================
John                       20/04/2005                    item A
                                                                  item B
                              21/04/2005                    item C
                                                                  item D

But what I need now is actually:

Customer Name     Transaction Date              Item
===============================================
John                       20/04/2005                    item A
                                                                  item B
John                       21/04/2005                    item C
                                                                  item D

For what I can see, problem can be solved if I can customise the "supress if duplicated" that implement on Customer Name to based on combination of Customer Name and Transaction Date. Is that possible in CrystalReport with editing the formula?

If yes, pls post some sample code of formula. Else, pls suggest others alternative to solve this problem. Thank You.
ASKER CERTIFIED SOLUTION
Avatar of Spykair
Spykair
Flag of South Africa image

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 Outin
Outin

Spykair forgot a closing  ) after CustomerName, but what he proposed is the solution:

CustomerName = previous(CustomerName) AND TransactionDate = previous(TransactionDate)


Greetz,

Outin

Avatar of b612_forever

ASKER

Thanks a lot. (btw, you forget the closing bracket before AND.....)
Great minds think alike :-)

Outin
what a luck Outin, we submit the form at the same time......
Glad I could help.

Thanks for the correcting me Outin. Like you said: Great minds think alike...but fools never differ :-)

Spykair