Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross-tab number of duplicate, non-dup, and total records using CR XI

Status
Not open for further replies.

moopenguin32

Technical User
Dec 23, 2008
20
0
0
US
I am using Crystal Reports XI and am trying to create a cross-tab that shows the number of duplicate records, the number of records that do not have duplicates (unique), and the total number. The end result should look like this:

Duplicate Unique Total
197 9927 10124

I am using the following formula to evaluate whether something is considered a duplicate:

Code:
//@Unique
If ((OnFirstRecord or
     OnLastRecord) or
(({ComputerSystem.SerialNumber} <> Previous({ComputerSystem.SerialNumber}) and
  {ComputerSystem.SerialNumber} <> Next({ComputerSystem.SerialNumber}))))
Then 1
Else 0

For building the cross-tab, I am using the @Unique formula for the columns and the ComputerSystem.Name field as the summarized field because everything has a name, but may not necessarily have a serial number.

The cross-tab ends up looking like this:

(Blank) 0.00 1.00 Total
179 18 9927 10124

There is not actually a column named (Blank). I just put it there as a place holder to show there is a column without a heading.

Also, for whatever reason, when I go into the cross-tab expert and click on the group options for the @Compliance formula, it is using another field to do the grouping rather than the formula. I'm guessing this is what is causing the problem.

Any assistance is greatly appreciated.

"Remember, today is the tomorrow you worried about yesterday." - Dale Carnegie
 
The @Compliance formula referenced towards the end of the post should be @Unique. I am only using one formula. Sorry for any confusion.

"Remember, today is the tomorrow you worried about yesterday." - Dale Carnegie
 
I just wanted to let everyone know that I figured this issue out.

The problem was I was comparing records based on the serial number to say whether or not they were duplicates. This caused an issue because some serial number fields were blank. Therefore, it was causing a blank column to show in the cross-tab.

To fix this, I updated the @Unique formula to:
Code:
If ((OnFirstRecord or
     OnLastRecord) or
(({ComputerSystem.Name} <> Previous({ComputerSystem.Name}) and
  {ComputerSystem.Name} <> Next({ComputerSystem.Name}))))
Then 1
Else 0

When I refreshed the report, the blank column was no longer in the cross-tab. This then allowed me to create the chart I wanted.

"Remember, today is the tomorrow you worried about yesterday." - Dale Carnegie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top