?
Solved

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

Posted on 2005-04-20
6
Medium Priority
?
489 Views
Last Modified: 2008-01-09
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
Comment
Question by:b612_forever
  • 2
  • 2
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
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

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

by:b612_forever
ID: 13823035
Thanks a lot. (btw, you forget the closing bracket before AND.....)
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
LVL 9

Expert Comment

by:Outin
ID: 13823048
Great minds think alike :-)

Outin
0
 
LVL 1

Author Comment

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

Expert Comment

by:Spykair
ID: 13823125
Glad I could help.

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

Spykair
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question