Sunday, July 20, 2014

How to get previous row value in Informatica using expression transformation?


Source:

customers table:

Customers table has data for columns cust_id, Year, City columns like below.



Expected Target Value:

Prev city column need to be populated as the previous city like below.


Implementation:

Use order by columns CUST_ID and Year in source qualifier transformation or have sorter transformation to sort these 2 columns.

Connect the columns to expression transformation and create columns as below:

CUST_ID (i/o)= CUST_ID
YAER (i/o)= YAER
CITY (i/o)= CITY
v_cust_id (variable)=v_prev_Cust_ID
v_old_city (variable)=v_prev_city
o_prev_City (output)=IIF(v_cust_id=v_prev_Cust_ID,v_old_city,null)
v_prev_city (variable)=CITY
v_prev_Cust_ID (variable)=CUST_ID

Mapping will look like below:



28 comments:

  1. It was so nice article and useful to Informatica learners. we also provide Informatica Course online training our Cubtraining is leader in providing Software Training

    ReplyDelete
  2. Great work, Keep posting solutions for Informatica

    ReplyDelete
  3. It was really a nice article and I was really impressed by reading this article. We are also giving all software Course Online Training.
    Qlikview Training | Informatica Online training

    ReplyDelete
  4. Nice Blog useful information about informatica
    Get more about online informatica training

    ReplyDelete
  5. Nice blog! Informatica Training introduces learners to Informatica Introduction, Configuration, performing tasks such as creating transformations, mappings, reusable objects, sessions and workflows to extract, transform and load data, Qualifier, source qualifier, SCD type and XML source, advance designer, planner & Mapping Features. More at Informatica Online Training

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Pretty great post. I just stumbled upon your blog and wished
    Thanks for some other magnificent post.for more details

    http://www.tekclasses.com/

    ReplyDelete
  9. Plenty of new stuff proper here!visit the below link

    http://www.tekclasses.com/

    ReplyDelete
  10. Brillant piece of information,if u r interested follow below link
    http://www.tekclasses.com/

    ReplyDelete
  11. Uniqe informative content, thanks for sharing.
    http://www.tekclasses.com/

    ReplyDelete
  12. Thanks for giving Good Example.
    Fantastic article, Viral. Very well written, clear and concise. One of the best links explaining one to many and hierarchy in Informatica. Thanks a lot.It is uaefull to me and my training Ithubonlinetraining center.

    ReplyDelete
  13. Thanks for giving Good Example.
    Fantastic article, Viral. Very well written, clear and concise. One of the best links explaining one to many and hierarchy Informatica. Thanks a lot.It is uaefull to me and my training Ithubonlinetraining center.

    ReplyDelete
  14. Thanks for giving Good Example.
    Fantastic article, Viral. Very well written, clear and concise. One of the best links explaining one to many and hierarchy Informatica. Thanks a lot.It is uaefull to me and my training Ithubonlinetraining center.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Informatica , kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on Informatica. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.

    For Free Demo Contact us:
    Name : Arunkumar U
    Email : arun@maxmunus.com
    Skype id: training_maxmunus
    Contact No.-+91-9738507310
    Company Website –http://www.maxmunus.com


    ReplyDelete
  17. Hi Buddy,

    Awesome article.
    Thanks for making that available
    . I've been using your help to build my own POC and will publish the steps in another blog soon.

    If your PowerCenter is on *nix, you can write the following statement in a script to capture the pmcmd return status.

    pmcmd gettaskdetails -s 5998 -u Administrator -p Administrator -f AAA -w wf_m_partition_string s_m_join_partition
    ret=$?

    case "${ret}" in
    0 )
    message='success ' ;;
    1 )
    message='Informatica is down ' ;;
    2 )
    message='can not connect to informatica server ' ;;
    esac



    By the way do you have any YouTube videos, would love to watch it. I would like to connect you on LinkedIn, great to have experts like you in my connection (In case, if you don’t have any issues).
    Please keep providing such valuable information.
    Many Thanks,
    Krishna

    ReplyDelete
  18. Hello There,


    Great info! I recently came across your blog and have been reading along.
    I thought I would leave my first comment. I don’t know what to say except that I have

    Good luck on your test and I'd be interested to hear your testing thoughts.
    Almost all function specifications I've seen so far are intellectual property of the respective organisation.
    But you can find some templates in Velocity, the Best Practices collection provided and maintained by Informatics Professional Services.
    I read multiple articles and watched many videos about how to use this tool - and was still confused! Your instructions were easy to understand and made the process simple.


    Ciao,
    Edison

    ReplyDelete
  19. Hiya,

    Great post. Can’t get any more straight forward than this article. Thanks!

    Lets suppose a consolidated record with multiple XREFS. There is non trust enabled column, which is populated in both the XREF and the recent one is surviving in BO as per the survivorship rules. Now, if a NULL update comes from source on one of these XREFS would it survive at BO? I know for Trust enabled columns, trust is automatically downgraded for NULL values, but how does this behave in non trust enabled columns?

    Great effort, I wish I saw it earlier.

    Muchas Gracias,
    Irene Hynes

    ReplyDelete
  20. Hi Pradeep,

    THANKS SO MUCH for sharing this! I would love to buy you a coffee since I now won’t be up all night that has been driving me crazy (until now!!). I just wish I knew what was going wrong but so glad it’s in the right place now! Thanks again:)


    The same case with the PUT API, while reating a PUT request we have to to provide PKEY_SRC_OBJECT (in case of update we can provide value for ROWID_OBJECT or for both). So, MDM will perform the check on PKEY_SRC_OBJECT, if it exits then update the record else will create a new record.

    I look forward to see your next updates.

    Obrigado,
    Irene Hynes

    ReplyDelete
  21. Hello There,

    This is one awesome blog. Much thanks again. Fantastic.

    while loading the data from stage to base object. on what basis I can say records get inserted or updated into the base objects. I guess my question is clear this time
    It is like a usual database trigger, Informatica MDM Training you shall configure it in your Message trigger setup under schema in model workbench.
    You can make the trigger generating events on changes happening on any of your custom columns (or) on any specific columns you choose.
    You have a check box to specify if you want your trigger to generate notification only on some selected columns.

    Great effort, I wish I saw it earlier.

    Thank you,
    Preethi.

    ReplyDelete
  22. Hi There,

    Thanks for the post. Very good details. Worked like a charm. Good directions.

    Let's say your record coming from source A and it is highly trusted,
    undergone match and merge and survived in BO with trust score.

    After some point of time again your record coming from different source B Informatica MDM Training USA
    which is having higher trust score and obviously it will find a match with
    your existing record in BO and since source B is highly trusted it will
    override the existing recrd in BO.

    Once again thanks for your tutorial.
    Many Thanks,

    Irene Hynes

    ReplyDelete
  23. Really nice blog post.provided a helpful information.I hope that you will post more updates like this Informatica Online Training

    ReplyDelete
  24. We can assume this post as Informatica Online Training part. I love all of the points you have made. A big thank you for your blog article. Really Cool.

    ReplyDelete
  25. I feel Informatica is the best way of solving some very complex IT problems and solutions anyhow.Apart from this it lays a base for solving complex problems.

    Informatica Read JSON

    ReplyDelete