Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
abhinavbose
Creator III
Creator III

Comparison of fields with conditions in Qlikview

Guys,

As per my requirement, I'm going to compare some fields of a customer with another customer as shown below (2 tables),

Screenshot_12.png

Screenshot_13.png

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.

7 Replies
ziadm
Specialist
Specialist

are these customer in two separate tables ...

abhinavbose
Creator III
Creator III
Author

No, the customers can be in single table or separate two tables. Both are possible.

ziadm
Specialist
Specialist

//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;

abhinavbose
Creator III
Creator III
Author

Thanks Ziad, Looking good. But what to do in case of a single table.

ziadm
Specialist
Specialist

best is to have the same approach .. if they are in the same file separate them into files .. Otherwise post sample data

ziadm
Specialist
Specialist

if this ok .. please mark correct and close the thread

abhinavbose
Creator III
Creator III
Author

No Ziad, this isn't ok for me. Please suggest any idea to go with single table.