Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

wajihakhan
New Contributor II

Link Table (Key Field Not Found Error)

Hi,

I am creating a link table based on three fact tables. But when i try to load it gives me an error that Field 'KEY' not found.

where 'KEY' is my composite key name. I can't understand what is an issue. Can anyone help me?

Thanks

9 Replies
aronwilliamson
Contributor

Re: Link Table (Key Field Not Found Error)

Please paste the table in or at least the key fields from your script:

i.e. ....as %Key_MyKey

mark6505
Valued Contributor III

Re: Link Table (Key Field Not Found Error)

Hi

Can you post the script and full error message?

From the limited information i would guess that you are not creating the Key correctly in one or more tables, so it doesn't exist when being called.

Mark

agigliotti
Honored Contributor II

Re: Link Table (Key Field Not Found Error)

share your script to try to help you.

shraddha_g
Honored Contributor III

Re: Link Table (Key Field Not Found Error)

share sample app or screenshots of the script

wajihakhan
New Contributor II

Re: Link Table (Key Field Not Found Error)

Here is my script

Fact1:

LOAD

MATNR&'|'&WERKS&'|'&SPMON as KEY,

    SPMON,

    MATNR,

    WERKS,

    MGVBR as [Total Usage Quantity]

FROM [lib://Tables/Fact1.qvd]

(qvd);

Fact2:

LOAD

    MATNR&'|'&WERKS&'|'&SPMON as KEY,

    SPMON,

    MATNR,

    WERKS,

    MNG02 as Requirement

FROM [lib://Tables/Fact2.qvd]

(qvd);

Fact3:

LOAD

     MATNR&'|'&WERKS as KEY,

    MATNR,

    WERKS,

    SPTAG,

    MZUBB as [Receipt Quantity],

    MAGBB as [Issue Quantity]

FROM [lib://Tables/Fact3.qvd]

(qvd);

LinkTable:

                Load

                Distinct

                       KEY,

                       MATNR,

                       WERKS,

                       SPMON

                       Resident Fact1;

       

Drop Fields

    MATNR,

    WERKS,

    SPMON

    from Fact1;

       

Concatenate(LinkTable)

      Load

                Distinct

                       KEY,

                       MATNR,

                       WERKS,

                       SPMON

                       Resident Fact2;

     

Drop Fields

    MATNR,

    WERKS,

    SPMON

    From Fact2;

       

Concatenate(LinkTable)

        Load

             Distinct

                  KEY,

                  MATNR,

                  WERKS

                  Resident Fact3;

       

Drop Fields

    MATNR,

    WERKS

    From Fact3;

wajihakhan
New Contributor II

Re: Link Table (Key Field Not Found Error)

Getting this error

Err.PNG

prma7799
Honored Contributor III

Re: Link Table (Key Field Not Found Error)

Try like this

Fact1:

LOAD

MATNR&'|'&WERKS&'|'&SPMON as KEY,

    SPMON,

    MATNR,

    WERKS,

    MGVBR as [Total Usage Quantity]

FROM [lib://Tables/Fact1.qvd]

(qvd);

Fact2:

LOAD

    MATNR&'|'&WERKS&'|'&SPMON as KEY,

    SPMON,

    MATNR,

    WERKS,

    MNG02 as Requirement

FROM [lib://Tables/Fact2.qvd]

(qvd);

Fact3:

LOAD

     MATNR&'|'&WERKS as KEY,

    MATNR,

    WERKS,

    SPTAG,

    MZUBB as [Receipt Quantity],

    MAGBB as [Issue Quantity]

FROM [lib://Tables/Fact3.qvd]

(qvd);

LinkTable:

Load

                Distinct

                       KEY,

                       MATNR,

                       WERKS,

                       SPMON

                       Resident Fact1;      

Concatenate(LinkTable)

      Load

                Distinct

                       KEY,

                       MATNR,

                       WERKS,

                       SPMON

                       Resident Fact2;      

Concatenate(LinkTable)

        Load

             Distinct

                  KEY,

                  MATNR,

                  WERKS

                  Resident Fact3;

Drop Fields

  MATNR,  

WERKS,

    SPMON

    from Fact1;     

Drop Fields

    MATNR,

    WERKS,

    SPMON

    From Fact2;

Drop Fields

    MATNR,

    WERKS

    From Fact3;

mdmukramali
Valued Contributor II

Re: Link Table (Key Field Not Found Error)

Hi,

Can you Reload the Data in Debug mode and check in Table you are getting this Error.

shraddha_g
Honored Contributor III

Re: Link Table (Key Field Not Found Error)

Debug script line wise and then check at which line you are getting this error

Community Browser