Scenario 26: How to create and use Active Lookup Transformation?
What is Active Lookup Transformation?
When lookup transformation return all the matching records from the Lookup table then it's called as an Active transformation.
This feature of Lookup has been introduced from 9.X version of Informatica Power Center tool.
Business Requirement: We have two table Product and currency now in the target table we have to populate all products with price after taking the all currency rate from currency table.
Note: There is no common column in both tables.
Source.
Let's Chat: I know! I know you will be saying hey we can achieve this though joiner transformation easily though we don't have column in both tables. A BIG THANK YOU... You have visited my previous posts and learned it well how to handle.
We all know there will be several way to accomplish business requirement. :-) Here I am opting Active Lookup approach to explain the use. Here we go....
Practically
Step 1: Import Product table. (Import your target table as well.)
Step 2: Expression.
Create one output port. (This port will be used in condition tab of Lookup)
SRC_DUMMY_ID (Output Port) = 1
Step 3: Lookup
a) Create Lookup transformation.... Wait. while creating don't forget to check the option which is shown in Picture below.
b) Add a port manually
DUMMY_ID (Decimal) Output & Lookup port should be checked.
c) Set condition Tab.
DUMMY_ID = SRC_DUMMY_ID
d) Override the SQL in properties tab.
SELECT CURRENCY.DESCRIPTION as DESCRIPTION, CURRENCY.RATE as RATE, 1 as DUMMY_ID, CURRENCY.ID as ID FROM CURRENCY
Step 4: Aggregator
Connect DESCRPTION, RATE and DUMMY_ID to Aggregator
(All port should be checked as GROUP port)
Step 5: Joiner
a) Create Joiner and Selected Sorted Input in Properties tab.
b) Now Drop all ports from Aggregator and Expression (Step2)
c) Select Ports from Lookup as Master Port in Port Tab.
d) Condition
DUMMY_ID=SRC_DUMMY_ID
Step 6: Expression
Take Prod_ID, Prod_Name, Price, Description, Rate Port from Joiner.
Create three output port for calculating price.
INR_PRICE (Output Port)=IIF(DESCRIPTION='INR', USD_PRICE*RATE)
SGR_PRICE (Output Port)=IIF(DESCRIPTION='SGR', USD_PRICE*RATE)
EURO_PRICE (Output Port)= IIF(DESCRIPTION='EURO', USD_PRICE*RATE)
Step 7: Aggregator
Connect all ports from expression.
Select PROD_ID port as GROUP port.
Create three output port to de-normalize the data.
O_INR_PRICE (Output Port)=MAX(INR_PRICE)
O_SGR_PRICE (Output Port)=MAX(SGR_PRICE)
O_EURO_PRICE (Output Port)= MAX(EURO_PRICE)
Step 8: Connect to your target.
BINGO!!!
Feel free to post your doubt in comment section or though contact form which you can find below the page.
Due to limitation, I can't attach exported .xml file which you can Import in your repository and see or analyse. (Feel free to mail me if you need .xml file with Scenario number and Question.)
If you like the approach and solution feel free to share with others.
Thanks.
hpandey.harsh@gmail.com
What is Active Lookup Transformation?
When lookup transformation return all the matching records from the Lookup table then it's called as an Active transformation.
This feature of Lookup has been introduced from 9.X version of Informatica Power Center tool.
Business Requirement: We have two table Product and currency now in the target table we have to populate all products with price after taking the all currency rate from currency table.
Note: There is no common column in both tables.
Source.
Source:
Two tables
Product
Table
Prod_ID
|
Prod_Name
|
Price_USD
|
2001
|
Laptop
|
300
|
2002
|
Desktop
|
200
|
2003
|
Mouse
|
20
|
Currency
Table
ID
|
Description
|
Rate
|
1
|
SGR
|
55
|
2
|
INR
|
62
|
3
|
EURO
|
42
|
Target
Table:
Prod_ID
|
Prod_Name
|
Price_USD
|
Price_SGR
|
Price_INR
|
Price_EURO
|
2001
|
Laptop
|
300
|
16500
|
18600
|
12600
|
2002
|
Desktop
|
200
|
11000
|
12400
|
8400
|
2003
|
Mouse
|
20
|
1100
|
1240
|
840
|
Let's Chat: I know! I know you will be saying hey we can achieve this though joiner transformation easily though we don't have column in both tables. A BIG THANK YOU... You have visited my previous posts and learned it well how to handle.
We all know there will be several way to accomplish business requirement. :-) Here I am opting Active Lookup approach to explain the use. Here we go....
Practically
Step 1: Import Product table. (Import your target table as well.)
Step 2: Expression.
Create one output port. (This port will be used in condition tab of Lookup)
SRC_DUMMY_ID (Output Port) = 1
Step 3: Lookup
a) Create Lookup transformation.... Wait. while creating don't forget to check the option which is shown in Picture below.
b) Add a port manually
DUMMY_ID (Decimal) Output & Lookup port should be checked.
c) Set condition Tab.
DUMMY_ID = SRC_DUMMY_ID
d) Override the SQL in properties tab.
SELECT CURRENCY.DESCRIPTION as DESCRIPTION, CURRENCY.RATE as RATE, 1 as DUMMY_ID, CURRENCY.ID as ID FROM CURRENCY
Step 4: Aggregator
Connect DESCRPTION, RATE and DUMMY_ID to Aggregator
(All port should be checked as GROUP port)
Step 5: Joiner
a) Create Joiner and Selected Sorted Input in Properties tab.
b) Now Drop all ports from Aggregator and Expression (Step2)
c) Select Ports from Lookup as Master Port in Port Tab.
d) Condition
DUMMY_ID=SRC_DUMMY_ID
Step 6: Expression
Take Prod_ID, Prod_Name, Price, Description, Rate Port from Joiner.
Create three output port for calculating price.
INR_PRICE (Output Port)=IIF(DESCRIPTION='INR', USD_PRICE*RATE)
SGR_PRICE (Output Port)=IIF(DESCRIPTION='SGR', USD_PRICE*RATE)
EURO_PRICE (Output Port)= IIF(DESCRIPTION='EURO', USD_PRICE*RATE)
Step 7: Aggregator
Connect all ports from expression.
Select PROD_ID port as GROUP port.
Create three output port to de-normalize the data.
O_INR_PRICE (Output Port)=MAX(INR_PRICE)
O_SGR_PRICE (Output Port)=MAX(SGR_PRICE)
O_EURO_PRICE (Output Port)= MAX(EURO_PRICE)
Step 8: Connect to your target.
BINGO!!!
Feel free to post your doubt in comment section or though contact form which you can find below the page.
Due to limitation, I can't attach exported .xml file which you can Import in your repository and see or analyse. (Feel free to mail me if you need .xml file with Scenario number and Question.)
If you like the approach and solution feel free to share with others.
Thanks.
hpandey.harsh@gmail.com
Can you explain ,without joining how did you add all the Ports to lookup ?
ReplyDeleteHi Soumya,
DeleteI didn't add all ports to lookup. I have added only port. Look for STEP 1 (B).
Instead of reading please implement it practically following steps. Your doubt will be clear.
Thanks
your information is really awesome as well as it is very excellent and i got more interesting information from your blog. iOS App Development Company in India
ReplyDeleteThis was so useful and informative. The article helped me to learn something new. Security alarm in Chennai
ReplyDeleteExpected and valid points are included in you blog.. I really liked and I got some clear ideas for improve my thoughts from well defined content... keep updating more for us... thanks for shared useful blog..
ReplyDeleteSAT Training Centre in Chennai
It’s really amazing that we can record what our visitors do on our site. Thanks for sharing this awesome guide. I’m happy that I came across with your site this article is on point,thanks again and have a great day. Keep update more information..
ReplyDeleteHome Interiors in Chennai
Hey ,
ReplyDeletewe can make use of unconnected lookup and achieve this solution instead of using Joiner,aggregator and Active lookup at all.
1) Take product table as source.
2) Create an unconnected lookup on currency table with join condition on Currency desc and rate as return value.
3) From exp, call
:LKP.LKP_curr('SGR') * 300
:LKP.LKP_curr('INR') * 300
:LKP.LKP_curr('EURO') * 300
Just great learning from you!
ReplyDeletevery very amazing explaintion....many things gather about yourself...yes realy i enjoy it
ReplyDeleteVmware Training in Chennai
Web Designing Training in Chennai
AWS Training in Chennai
Linux Training in Chennai
Microsoft Azure Training in Chennai
Just read your website. Good one. I liked it. Keep going. you are a best writer your site is very useful and informative
ReplyDeletethanks for sharing!
android development company in Chennai
I just go through your blog.Excellent work.Keep it up....
ReplyDeleteInterior Designers in Chennai
Interiors in Chennai
Good Interior Designers in Chennai
Nice blog information.Update more info...
ReplyDeleteTop Interior Decorators in Chennai
Top 10 Interior Decorators in Chennai
I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.
ReplyDeletePsoriasis Treatment
I simply couldn’t depart your site before suggesting that I really enjoyed the usual information an individual supply in your visitors? Is going to be again steadily to check out new posts.
ReplyDeleteLogistic ERP
Transport ERP
Manufacturing ERP
ERP software companies
Best ERP software
ERP for the manufacturing industry
It has been just unfathomably liberal with you to give straightforwardly what precisely numerous people would've promoted for an eBook to wind up making some money for their end, basically given that you could have attempted it in the occasion you needed.
ReplyDeleteHadoop Training in Chennai
I read that Post and got it fine and informative. Please share more like that...
ReplyDeleteTrading erp software in chennai
Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
selenium training in chennai
I am definitely enjoying your website. You definitely have some great insight and great stories.
ReplyDeletejava training in chennai | java training in bangalore
java online training | java training in pune
java training in chennai | java training in bangalore
Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....
ReplyDeletepython training in pune
python online training
python training in OMR
I am sure this post has helped me save many hours of browsing other related posts just to find what I was looking for. Many thanks!
ReplyDeleteBlueprism training in marathahalli
Blueprism training in btm
Blueprism online training
Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.
ReplyDeleteAmazon Web Services Training in Velachery, Chennai |AWS Training in Velachery , Besant Technologies
Amazon Web Services Training in Chennai | AWS Training in Chennai
Amazon Web Services Training in Chennai |Best AWS Training in Chennai
Amazon Web Services Training in Chennai | AWS Training in OMR,Chennai
Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Python online training
uipath online training
Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision.
ReplyDeleteArtificial Intelligence Certification Training
Java Certification Training
AWS Certification Training
Machine Learning Certification Training
Data Science Certification Training
DevOps Certification Training
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
ReplyDeleteSoftware Testing Services
Functional Testing Services
Test Automation Services
QA Automation Testing Services
Regression Testing Services
API Testing Services
Compatibility Testing Services
Performance Testing Services
Security Testing Services
Software Testing Company
Software Testing Services in USA
Software Testing Companies in USA
I need to thank you for the endeavors you have carefully recorded this site. I'm expecting to see a similar high-grade blog entries from you later on too. Truth be told, your experimental writing capacities has roused me to get my own, own blog now ;) best interiors
ReplyDeleteThey're produced by the very best degree developers who will be distinguished for your polo dress creation. You'll find Ron Lauren inside an exclusive array which includes particular classes for men, women.
ReplyDeletedata scientist training in hyderabad