Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reg:Query on Synthetic Key

Hi All,

I would like to know the difference between 'qualify & unqualify ' statements and 'Key field' deceleration

and giving 'Alias' to fields.Because all above doing same effect that breaking key.

So let me know the diffrence between these and when to use.

Thanks & Regards

Jai

1 Reply
Not applicable
Author

The QUALIFY statement puts the tablename before each field that is indicated in the table when loaded.

For instanc

qualify *;

turns qualification on for all field names.

qualify "*ID";

turns qualification on for all field names ending with ID

qualify "NR*", A;

turns qualification on for A and all field names beginning with NR.

The UNQUALIFY statement does the opposite.

unqualify *; turns qualification off for all field names.

unqualify '%*_Key'; turns qualification off for all fields that start with a % and end with '_Key'

The last UNQUALIFY statement is often used to denote key fields.


QUALIFY *;
UNQUALIFY '%*_Key';
Employee:
LOAD id AS %EmployeeId_Key, // the use of AS here is giving the field 'id' an alias named %EmployeeId_Key
name,
address,
city,
.....
FROM Employee.qvd (qvd);


This would give the following fields


%EmployeeId_Key
Employee.name
Employee.address
Employee.city


The field %EmployeeId_Key can now easily be used to link two or more tables. This a key field.

We could create another table with the same key to link them.