Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Guys,
As per my requirement, I'm going to compare some fields of a customer with another customer as shown below (2 tables),
1. I've got the fields matched from these 2 tables. But I need to get the number of fields with some conditions,
Data type
Min Occurs
Max Occurs
M/C/O and
Length
Expected Result:
As per my above data,
1. Total Fields matched with 1 condition - 1 (Field name - SCAC; Condition matched - Data type)
2. Total Fields matched with 4 conditions - 1 (Field name - NA; Conditions Matched - Data type, Min Occurs, Max Occurs and Length) and
3. Total Fields matched with 5 conditions - 1 (Field name - SHPM_IDEN_NO; Conditions Matched - Data type, Min Occurs, Max Occurs, M/C/O and Length).
Similarly, I need to get all the possible combinations in case of several conditions for a field. Is this possible to do guys?
Please suggest any idea.
Thanks,
Siva.
are these customer in two separate tables ...
No, the customers can be in single table or separate two tables. Both are possible.
//Assuming Customers are in two tables Table1 and Table2
Table1:
Load *,
FieldName & '|' & DataType & '|' & MinOccurs & '|' & MaxOccurs & '|' & Length as Key1;
load * Inline [
FieldName,DataType,MinOccurs,MaxOccurs,Length
1,AA,BB,CC,DD,EE
2,BB,CC,DD,EE,FF
3,DD,DD,EE,FF,GG
];
NoConcatenate
Table2:
Load *,
FieldName & '|' & DataType & '|' & MinOccurs & '|' & MaxOccurs & '|' & Length as Key2;
load * Inline [
FieldName,DataType,MinOccurs,MaxOccurs,Length
1,AA,BB,CC,DD,EE
2,KK,CC,DD,EE,FF
3,CC,MM,EE,FF,GG
];
CompareTable:
load FieldName,Key1
Resident Table1;
Left Join
load FieldName,Key2
Resident Table2;
DROP Tables Table1,Table2;
Thanks Ziad, Looking good. But what to do in case of a single table.
best is to have the same approach .. if they are in the same file separate them into files .. Otherwise post sample data
if this ok .. please mark correct and close the thread
No Ziad, this isn't ok for me. Please suggest any idea to go with single table.