Skip to Content
author's profile photo Former Member
Former Member

Scripting help.

Hi Team,

I have one requirement where i have 2 tables :

Cabinet master Table :

Cabinet Outlet Company Code C1 O1

CC1

C2 O2 CC2 C3 O3 CC3

and Cabinet Transaction table : (Input Schema )

Cabinet Outlet CompanyCode cal day C1 O5 CC5 20140101 C2 O2 CC2 20140102 C3 O3 CC7 20140103

Now my requirement is :

I have to check whether the Cabinet is placed in the right outlet or not by performing the lookup on th Cabinet master and i need to display the Match ID

where it has to display the value as Y or N, Y means the Cabinet is placed in the correct outlet and N means the Cabinet is placed in the wrong Outlet ( By performing the lookup on the Cabinet Master Table ) . Now finally my outlput should display as

Calday Cabinet Outlet MatchID Correct Company code Correct Outlet 20140101 C1 O5 N CC1 O1 20140102 C2 O2 Y 20140103 C3 O3 N CC3 O3

Pls help me how to achieve this.

Regards,

Praveen.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 13, 2015 at 09:32 AM

    Use lookup_ext built-in function (right-click in Schema Out in your Query transform and select New Fuction Call.. > Lookup Functions > lookup_ext).

    • Specify 1 conditions: Cabinet = Cabinet.
    • Specify 2 output columns: Company Code --> Correct Company Code and Outlet --> Correct Outlet.

    Add a 2nd Query transform and map:

    • Correct Company Code to decode(Company Code = Correct Company Code and Outlet = Correct Outlet, null, Correct Company Code)
    • Correct Outlet to decode(Company Code = Correct Company Code and Outlet = Correct Outlet, null, Correct Outlet)
    • MatchId to decode(Company Code = Correct Company Code and Outlet = Correct Outlet, 'Y', 'N')
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.