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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Complement Set in Crystal Reports

Status
Not open for further replies.

ebstarasia

IS-IT--Management
Mar 9, 2011
62
US
I have a list of reports/data that all contain one or more "event codes." What I am trying to do is compare the event codes in each data to the list of all possible "event codes" and have a list of what the data is lacking besides their reference number.

For example:

if the control or key set of event codes were {1,2,3,4,5}

i want to compare the following reports and have them return what code they are missing

Data A: {1,2,5} therefore next it would say {3,4}
Data B: {1,3} --> {2,4,5}

In a nutshell how would I write a relative complement of A (control set) & B (data)??
 
error message for

distinctcount({table.eventcode},{table.housebills}) = k

"there must be a group that matches this field
 
ebstarasia,

[tt]distinctcount({table.eventcode},{table.housebills}) = k
^^^^^^^^^^^^^^^^^^-- Group Name[/tt]

Without reviewing the entirety of LBass's solution, you need to have a group on housebills. What group number/level, I am not sure.

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
I thought you said that you were evaluating the event codes per house bill, so I am assumed that fields was what you were grouping on. Replace {table.housebill} with the field you are actually grouping on.

-LB
 
LB,

basically what your code does, solve my the main issue of only displaying the event codes per house bill.

layout looks like this:

Company Name
HBL number missing event code

Design
Group Header#1: Name of Customer/Company
Group Header#2(suppress): House bill {@rest}
Details (suppress):House bill Customer name EventCode {@accum}
Group Footer#2: House Bill {@displaymissingcode}
Group Header#1:

Preview
GemStone
SABC1017
SABC1754 UV, OA, AV
SABC1566

Morning Greeting
SABC5693 CR, CT, AL, AR, RL
SABC7845 OA, CT, RL, AV
SABC6632 CR, CT, AL, RL, AR, AV

Excell Bikes
SABC7531 VA, UV, OA, CR
SABC2486

I am trying to now only show just the house bills that have missing codes. the house bills with nothing missing have the house bill showing but then nothing following, causing blanks in the report. Trying to get it so that there isn't a huge blank gap just in case one company has more than 10 house bills and the 5 one has something missing then another gap before the next company.

Hope i didn't lose anyone
 
The house bill wouldn't show either if you used my section suppression suggestion, so I'm wondering how you implemented that. You should also have checked "suppress blank section".

-LB

 
I got it to work. what i did was told it to suppress
{@displaymissingcodes} = " ";

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top