3 Replies Latest reply: May 7, 2014 6:53 AM by Ashfaq Mohammed RSS

    INLINE


      Hi ,

       

      I have a QVD file shown below.

       

      PRODUCT:
      LOAD MARKET_NAME,
          
      FAMILY_ID,
          
      AST_PROMO_FLG,
           PRODUCT_NAME,
          
      MARKET_NAME,
      FROM
      [D:\PRODUCT.qvd]

       

      Now here I have informations like

      PRODUCT_NAMEFAMILY_ID
      AA111
      BB222
      CC333
      DD444
      EE555
      FF666
      GG777

       

      NOW I WANT TO CHANGE THE FAMILY_ID FOR SELECTED PRODUCTS LIKE

      EE = 999 & GG = 888.

       

      CAN ANY ONE HELP ME ON THE SAME.

       

      THANKS IN ADVANCE.

       

      REGARDS,

      KK

        • Re: INLINE
          Matthijs ten Hoedt

          Hi,

           

          You can use a combination of mapping table and applymap.

           

          Example of adjusted script syntax:

           

          MappingTable:

          MAPPING

          LOAD * INLINE

          [

          FAMILY_ID, FAMILY_ID_NEW

          999, 999_NEW

          888, 888_NEW

          ]

          ;

           

          And for your QVD use the following load:

           

          PRODUCT:
          LOAD MARKET_NAME,
               APPLYMAP('MappingTable',
          FAMILY_ID, FAMILY_ID) AS FAMILY_ID,
              
          AST_PROMO_FLG,
               PRODUCT_NAME,
              
          MARKET_NAME,
          FROM
          [D:\PRODUCT.qvd]

           

          The disadvantage of this solution is that your QVD load is no longer optimized (= fast). Maybe you already have a resident load later in the script in which you can incorporate the function?

           

          Kind regards,

           

          Matthijs

          • Re: INLINE
            Kaushik Solanki

            Hi,

             

                 You can use the concept of Mapping table.

             

                 You will get the detailed information about this function in Help section of QlikView Desktop.

             

            Regards,

            Kaushik Solanki

            • Re: INLINE
              Ashfaq Mohammed

              Hi,

               

              Try below

               

              Temp:
              Load * Inline
              [
              
              PRODUCT_NAME,    FAMILY_ID
              AA,    111
              BB,    222
              CC,    333
              DD,    444
              EE,    555
              FF,    666
              GG,    777
              
              ];
              
              
              Main:
              Load *,if (PRODUCT_NAME='EE',999,if(PRODUCT_NAME='GG',888,FAMILY_ID)) as FAMILY_ID1
              resident Temp;
              
              drop Table Temp;
              

               

              Regards

              ASHFAQ