The Qualify statement is used for switching on the qualification of field names, i.e. field names will get the table name as a prefix.’
In situation where we have two (or more) Tables with the same field names:
Product
Payment
The Qualify statement will assign name of the Table to fields:
Remember
To use the script below the Excel file must be saved in the same folder that your qvd file
Otherwise you will need to make changes the this path - [Qualify.xlsx]
QUALIFY *; Product: LOAD[Serial No], Category, Value FROM Qualify.xlsx (ooxml, embeddedlabels, tableis Product);
QUALIFY *; Payment: LOAD[Serial No], Category, Value FROM Qualify.xlsx (ooxml, embeddedlabels, tableis Payment);
The Outcome:
Table Viewer:
Read only if you need to know more....
If we have not used ‘QUALIFY’ statement in situation as above Qlikview would map both of the Tables with outcome like below:
The end result -merge of those two Tables is correct only for the “Serial No” fields
The “Value” and “Category” fields although merged is none of use to us.
To fix this we can only Qualify fields that we do not want to associated:
QUALIFYCategory, Value; Product: LOAD[Serial No], Category, Value FROM Qualify.xlsx (ooxml, embeddedlabels, tableis Product);
QUALIFYCategory, Value; Payment: LOAD[Serial No], Category, Value FROM Qualify.xlsx (ooxml, embeddedlabels, tableis Payment);
or by using UNQUALIFY statement:
(which works as opposite to QUALIFY)
QUALIFY *; UNQUALIFY[Serial No]; Product: LOAD[Serial No], Category, Value FROM Qualify.xlsx (ooxml, embeddedlabels, tableis Product);
QUALIFY *; UNQUALIFY[Serial No];
Payment: LOAD[Serial No], Category, Value FROM Qualify.xlsx (ooxml, embeddedlabels, tableis Payment);
In second example the ‘QUALIFY *’ part will add Table name to all fields and the UNQUALIFY statement will remove those names only from specified fields(this method is very useful if we got large numbers of fields)