3 Replies Latest reply: Nov 19, 2013 2:27 PM by Alan Farrell RSS

    What is the meaning of Lookup function.

    Agnivesh Kumar

      Please tell me all about lookup function with a example in detail.

      I am very confused about it .

      Thanks .

        • Re: What is the meaning of Lookup function.

          Hi,

           

          There is something in the resource section, hope it helps.

           

          http://community.qlik.com/docs/DOC-3412

           

          Regards,

           

          Gerrit

          • Re: What is the meaning of Lookup function.
            Alan Farrell

            ApplyMap is a lookup function, it's when you want to match a value from one table to another and return a new value based on that match.

             

            Like VLOOKUP in Excel

             

            below is an example

             

            I created a qvd of a mapping table containing 2 columns

             

            I need to add Warehouse Description to my Chambers Table that contains a common field of Warehouse

             

            2013-11-12_2216.png

             

            Then in my chamber table I use the ApplyMap function to lookup against my mapping table above, so I can add the Warehouse Description to Chamber Table

             

            2013-11-12_2216_001.png

             

            Basically it has allowed me add the Warehouse Description to my Chambers table, like you would use the VLOOKUP Function in Excel

             

            I hope that helps

            • Re: What is the meaning of Lookup function.
              Srikanth P

              Generally, the LookUp function is used to get the specific field value corresponding on the different field value in the same table.

               

              Here is info from help file:


              lookup(fieldname, matchfieldname, matchfieldvalue [, tablename])

               

              Returns the value of fieldname corresponding to the first occurrence of the value matchfieldvalue in the field matchfieldname.

              Fieldname, matchfieldname and tablename must be given as strings (e.g. quoted literals).

              The search order is load order unless the table is the result of complex operations such as joins, in which case the order is not well defined.

              Both fieldname and matchfieldname must be fields in the same table, specified by tablename. If tablename is omitted the current table is assumed.

              If no match is found, null is returned.

              Example:

              lookup('Price', 'ProductID', InvoicedProd, 'pricelist')

               

              In the above example: Price of InvoiceProd value from pricelist table.