LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Reading of all the data of the column using loops

    Employee
    Posted 07-09-2014 14:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Shalaka

    How loops can be built in LAE graph. e.g i want to read all the values of particular columns using loops and make further operations on the values.

    Table1
    prod_code cycle_start_dt cycle_end_dt
    xyz 01-Jan-2012 31-dec-2014


    Table2
    prod_code eff_start_dt eff_end_dt
    xyz 01-Jan-2012 03-mar-2013
    xyz 08-may-2012 5-oct-2012
    xyz 7-Dec-2012 31-dec-2014


    for product xyz, table 1 has 1 row and table 2 has 3 rows. Product in table2 is not configured continously. it has been configured in 3 cycles
    Now i need to find of the gap of days when the prod was not available/configured.

    condition 1 check if product cycle_start_dt == eff_start_dt then
    get the gap of period from table2

    e.g output shoud return below 2 rows

    product start_dt end_dt
    xyz 03-mar-2013 08-may-2012
    xyz 5-oct-2012 7-Dec-2012


    pls let me know how to acheive. loops?

    Shalaka

    xyz 03-mar-


  • 2.  RE: Reading of all the data of the column using loops

    Employee
    Posted 07-11-2014 05:54

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: DanRosenblatt

    Hi Shalaka-- I've replied to you via email as well but will post my example graph here as well for anyone else looking to solve a similar problem. As I mentioned, a bit more logic will probably need to be added here, but the key is persisting the eff_end_dt field in Table2 from one record to be compared to the eff_start_dt of the next record. The length of the gap between the two dates can then be calculated using the dateSubtract() function.

    dateGap.brg