1 Reply Latest reply on Jun 12, 2018 11:24 AM by c-phaviland@kinaxis.com

    LOOKUP function help

    krishna334 Apprentice

      Hi All,

       

      Can someone tell me how exactly LOOKUP function works.

       

      I have a worksheet based on ScheduledReceipts in which I have pulled only 3 columns as a sample:

       

      Part, Order Id and Line .

       

      What I want to do is to pull the Part's corresponding ABC Code using LOOKUP function.

       

      I have another table called Part (with id Part itself).In this table I have just 2 columns Part and ABCCode.

      I have grouped Part column.

       

      I tried creating LOOKUP function in ScheduledReceipts table as  LOOKUP(ABCCode, Part!).

      But it is not showing anything data.

       

      Could you please tell me what is it that I am not correct in the Formula.

       

      Moderators please move my post to appropriate place if I have posted it wrongly.

       

      Thanks in advance.

        • Re: LOOKUP function help
          c-phaviland@kinaxis.com Kinaxis Support

          I would suggest that you look in CHAPTER 51 of the RapidResponse Resource Authoring Guide.

          There is a whole section on the two variations of LOOKUP there.

          It sounds as though you are trying to use the normal worksheet LOOKUP function that has a syntax like:

               LOOKUP(valueExpression, worksheetId, defaultValue, rule, returnExpression)

          The valueExpression is what you are attempting to match in your ScheduledReceipt worksheet to get the LOOKUP result from your Part worksheet. In your case, it is the Part that you need to match. If the Part column in your Part worksheet is a reference, then the valueExpression would be simply Part. If you have the keys on your Part worksheet broken out into separate columns, then the valueExpression might need to be {Part.Name, Part.Site.Value}.

          The worksheetId is the worksheet ID of the Part worksheet that you are doing the lookup to get the ABCCode.

          The defaultValue is whatever you want it to be if the Part is not found.

          The rule would be Exact.

          The returnExpression would be the column name of the ABCCode column.

          There are rules about how the Part worksheet (in this case) needs to be constructed; regarding grouping columns for the lookup match columns (for example).

          Please reference the guide for more information.

           

          HOWEVER...

          Why would you bother doing a LOOKUP for this? I am assuming this is just an exercise to see how LOOKUP works?

          The ScheduledReceipt table has a Part reference right on it. It is FAR more efficient to simply add the column directly to the ScheduledReceipt worksheet containing the Part.ABCCode.