Solved

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

Posted on 2005-04-20
Medium Priority
489 Views
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.
0
Question by:b612_forever
• 2
• 2
• 2

LVL 10

Accepted Solution

Spykair earned 450 total points
ID: 13822878
Highlight both fields: (Customer Name and Transaction Date)  -> Format objects -> click on the X+2 next to "SUPPRESS".
Then type this formula:
CustomerName = previous(CustomerName AND TransactionDate = previous(TransactionDate)

Hth,
Spykair
0

LVL 9

Expert Comment

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

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

Greetz,

Outin

0

LVL 1

Author Comment

ID: 13823035
Thanks a lot. (btw, you forget the closing bracket before AND.....)
0

LVL 9

Expert Comment

ID: 13823048
Great minds think alike :-)

Outin
0

LVL 1

Author Comment

ID: 13823080
what a luck Outin, we submit the form at the same time......
0

LVL 10

Expert Comment

ID: 13823125

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

Spykair
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customerâ€™s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. â€¦
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirementsâ€¦
Integration Management Part 2
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micrâ€¦
###### Suggested Courses
Course of the Month8 days, 22 hours left to enroll