Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Lead/lag series

  1. #1
    Join Date
    Nov 2014
    Posts
    15

    Default Lead/lag series

    Hi I am planning to estimate forecast of revenue of my project. I am having data of last few years. I want to generate a new column which contains the revenue lag. Example is in Revenue lag column the value of February is equal to the value of January in revenue column, Value of march in revenue lag column is equal to value of revenue in february column.

    Month Product Revenue Revenue Lag
    ------- --------- -------------- -------------
    Jan2012 A 10
    Feb2012 B 13
    Mar2012 C 23
    Apr2012 D 14
    May2012 E 45
    Jan2012 A 12 10
    Feb2012 B 16 13
    Mar2012 C 12 23
    Apr2012 D 23 14
    May2012 E 12 45
    Jan2013 A 67 12
    Feb2013 B 78 16
    Mar2013 C 45 12
    Apr2013 D 34 23
    Last edited by rahulreddy88; 11-13-2014 at 03:43 PM.

  2. #2
    njain111 Guest

    Default

    In a transformation get your data --> sort your data by product, year-month asc -->Use Analytics Query step (New Field=Revene Lag, Subject=Revenue, Subject Lag, N=1)

    I assumed you wanted to get lag revenue for a specific product.

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Quote Originally Posted by njain111 View Post
    In a transformation get your data --> sort your data by product, year-month asc -->Use Analytics Query step (New Field=Revene Lag, Subject=Revenue, Subject Lag, N=1)

    I assumed you wanted to get lag revenue for a specific product.
    But don't forget to set the group on the Analytic Query to be your product!

  4. #4
    njain111 Guest

    Default

    Quote Originally Posted by gutlez View Post
    But don't forget to set the group on the Analytic Query to be your product!
    That's right. I missed that.

  5. #5
    Join Date
    Nov 2014
    Posts
    15

    Default

    I have done the same way you said like group field -> product, New Field -> Revenue lag, Subject-> Revenue and Lag N=1. I am getting my output as Null. Can you help me please. Is there is any way that i can use Month and product as key for shifting (lag) my values of product.

  6. #6
    njain111 Guest

    Default

    Can you share your transformation?

    Sort step I suggested will take care of lag by prod,month,year.


    Quote Originally Posted by rahulreddy88 View Post
    I have done the same way you said like group field -> product, New Field -> Revenue lag, Subject-> Revenue and Lag N=1. I am getting my output as Null. Can you help me please. Is there is any way that i can use Month and product as key for shifting (lag) my values of product.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.