Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I came across a scenario to create a composite key in compose
For eg: Key1 & '~' & Key2 AS Key1key2.
Is there a effective way in compose to create this kind of key?
#qlikcompose, #compositekey
Hello @hsardar yes, you should be able to get the key you are asking for in Compose.
You can create a new attribute in the model for the composite key you want to build., and validate the model. Then in the DWH, you build an expression for this new composite key using CONCAT operation. You can then decide if you like to keep the original keys.
For example:
The table, 'order details' has 2 PKs, ProductID and OrderId. So in the model, the 'order details' table will look like this:
1. Add the new attribute for the composite key in the model and remove the existing PKs from the 'order details table'. Your model will look like this:
2. Validate the model
3. In the DWH mapping use this expression for the new composite key, OrderId_product_Id'
CONCAT(${OrderId}, '&', ${ProductID})
Like this:
4. Validate the DWH and generate the instructions.
Hope this helps!
If you have questions or need help, please open a case with support and we should be able to walk you thru the steps.
Thanks,
Nanda
See my reply in your post:
https://community.qlik.com/t5/Qlik-Compose-for-Data-Warehouses/Compose-Modelling/td-p/2001372
Hello @hsardar yes, you should be able to get the key you are asking for in Compose.
You can create a new attribute in the model for the composite key you want to build., and validate the model. Then in the DWH, you build an expression for this new composite key using CONCAT operation. You can then decide if you like to keep the original keys.
For example:
The table, 'order details' has 2 PKs, ProductID and OrderId. So in the model, the 'order details' table will look like this:
1. Add the new attribute for the composite key in the model and remove the existing PKs from the 'order details table'. Your model will look like this:
2. Validate the model
3. In the DWH mapping use this expression for the new composite key, OrderId_product_Id'
CONCAT(${OrderId}, '&', ${ProductID})
Like this:
4. Validate the DWH and generate the instructions.
Hope this helps!
If you have questions or need help, please open a case with support and we should be able to walk you thru the steps.
Thanks,
Nanda