9 Replies Latest reply: Nov 15, 2017 12:46 AM by Shraddha Gajare RSS

    Link Table (Key Field Not Found Error)

    wajiha khan

      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

        • Re: Link Table (Key Field Not Found Error)
          Aron Williamson

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

           

          i.e. ....as %Key_MyKey

          • Re: Link Table (Key Field Not Found Error)
            Mark Little

            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

            • Re: Link Table (Key Field Not Found Error)
              Andrea Gigliotti

              share your script to try to help you.

              • Re: Link Table (Key Field Not Found Error)
                Shraddha Gajare

                share sample app or screenshots of the script

                • Re: Link Table (Key Field Not Found Error)
                  wajiha khan

                  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;

                    • Re: Link Table (Key Field Not Found Error)
                      P M

                      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;

                    • Re: Link Table (Key Field Not Found Error)
                      wajiha khan

                      Getting this error

                      Err.PNG