Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
What was the wrong in the below script as it creating synthetic keys
TRN_TM_RISK_COUNTRY_MAP:
Mapping LOAD
COUNTRY_CODE as T_M_COUNTRY_CODE,
COUNTRY_NAME as T_M_COUNTRY_NAME
From
EXT_COUNTRY.qvd](qvd);
T_TRANSITION_MATRIX:
LOAD *,
ApplyMap('TRN_TM_RISK_COUNTRY_MAP',T_M_COUNTRY_CODE) AS T_M_COUNTRY_NAME;
LOAD %T_M_ID ,
RISK_COUNTRY AS T_M_COUNTRY_CODE
FROM
TRANSITION_MATRIX_*.qvd (qvd) ;
Just the above code itself is creating a synthetic key?
I think you should add the script or a Qlik doc.
It's difficult to understand where your small piece of code can create a syn key
And you can also read this
Hi
From your script, Result will have only one table .
Please provide full script
Synthetic key will be formed when the tables are linked with more than one filed ...check the fields in your data model ...using table viewer will help you to identify the Synthetic keys
Hi Sunny,
we have synthetic keys like
..or it could fail due to a closing square bracket with no corresponding opening square bracket.
maybe you can concatenate the 2 transition_matrix tables
Check the
T_TRANSITION_MATRIX table and
CDM_T_TRANSITION_MATRIX_31_Mar-16
the above code is not causing the synthetic key
to avoid the synthetic key , you can rename the fields using as key word
if you want to like the tables with both the fields than build a composite key for the same
LOAD T_M_ID &'-'& T_M_COUNTRY_CODE as Key in both the tables and rename all the other fields
Hi
Its depends on your data model,
We can remove synthetic key by followings
1. Rename the fields (For Ex: in CDM.Transition_matrix_31_Mar_16, you can rename T_M_Country_Code as CDM_T_M_Country_Code)
2. Create a composite key like %T_M_ID & T_M_Country_Code As %Key in Both Tables and "remove or rename" the common fields
3. You can go with concatenate the both tables