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 Mike Lewis 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 2

Status
Not open for further replies.

ebstarasia

IS-IT--Management
Mar 9, 2011
62
US
referring to forum discussion

(Complement Set in Crystal Reports)


I am now trying to go a step further in displaying the missing event codes.

I am not trying to create an array based on conditional events. Let me explain:

What i have at the moment is

{@accum}
whileprintingrecords;
stringvar x;
if not({EDI_315_Events.EVENTCODE} in x) then
x:= x + {EDI_315_Events.EVENTCODE} + ", ";

{@displaymissingcodes}
whileprintingrecords;
if {v_oihouse.CUSTOMER} = "BELK" then
(
stringvar x;
stringvar array y := ["AE","VD","VA","UV","OA","AV"];
numbervar i;
numbervar j := ubound(y);
stringvar z;
for i := 1 to j do(
if not(y in x) and
not(y in z) then
z:= z + y + ", ");

if len(z)>2 then
left(z,len(z)-2);
)
else if {v_oihouse.CUSTOMER} = "BROOKSTONE STORES, INC" then
(

stringvar x;
stringvar array y := ["AE","VD","VA","UV","OA","I","CR","CT","AL","RL","AR","AV"];
numbervar i;
numbervar j := ubound(y);
stringvar z;
for i := 1 to j do(
if not(y in x) and
not(y in z) then
z:= z + y + ", ");

if len(z)>2 then
left(z,len(z)-2);
)

What I want to do now, is to check the missing event codes. For example, for "AR", before putting that into the array, I want to check to see if

masterbill.FINALETA <= CurrentDate

if YES then "AR" will need to be added into the array to be displayed.

Even if "AR" is missing, it should only be displayed if the new condition applies.
 
for i := 1 to j do(
if not(y in x) and
not(y in z)and
{masterbill.FINALETA} <= CurrentDate then
z:= z + y + ", ");

-LB
 
I don't see how that will add "AR" string into the array.

I should also add that there will be other conditional statements for the other EDI event codes as well. I was just trying to get an idea of how to do one.
 
Any array element that is missing and also meets the criterion would be added. I thought that was what you wanted. Did you try it?

-LB
 
I did try it. It's not doing exactly what I need it to do. Maybe I phrased my description wrongly. Let me try again,

Each customer will have a different set of EDI event codes. which is array y.
For BELK it is ["AE","VD","VA","UV","OA","AV"]
For BROOKSTONE ["AE","VD","VA","UV","OA","I","CR","CT","AL","RL","AR","AV"]
These are all the different codes that they could have.

Array z is the final array that is created by comparing arrays x and y.

What I am trying to do is before it creates array z, check the events further.

if one of the house bills have their finalETA date <= currentdate then array z should get string "AR"





Should I possibly write some IF statements before array y is created. Basically, using those conditional statements to build the comparative array against array x. if so, then I'm having issues with writing nested conditional statements to add elements to an array.

Does any of this make sense?

 
I don't know what you mean by 'house bill'. Are you saying that under some conditions you want an event code to appear in the "missing" codes array not because it is missing, but because it meets some other criterion?

Also, can you remind me why you are using hard coded arrays per customer instead of using a table of event codes associated with that customer?

-LB
 
the house bills are the customers different shipments.

From what I've been told, we want the event code to be added to the missing array if its missing but only displayed if it meets the criteria. So say if two shipments have missing "AR" "AV" & "AD" but shipment a has conditions where only "AV" and "AD" need to be displayed and shipment b's conditions only display "AD"

I only thought of using hard coded arrays to possibly solve this new problem. Originally from the last thread posting, as you suggested, used a table of event codes associated with different customers. As shown above.
 
I meant for array y, not x--why isn't a table used for this?

As for house bills, are they what you are collecting in array x? Or are they what you are showing in array y? I don't understand where shipments fit into all of this, so I can't tell where the shipment dates should be evaluated. I think this would be easier if you explained what you grouping on, and show some sample data.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top