1 Reply Latest reply: Mar 28, 2013 3:30 AM by Kaushik Solanki RSS

    Need Help: how to get data of previous row from a specified row

    Deepak Urs

      Hi,

       

      I have requirement where, i have a set of values in a table as shown below

       

      Table1

      CompanyRatingDate
      Comp1XYZ01-jan-2011
      Comp1YY01-feb-2011
      Comp1Z01-mar-2011
      Comp2XX01-jan-2011
      Comp2XXX02-feb-2011
      Comp2Z03-sep-2012
      Comp2Y04-oct-2012
      Comp3YY01-apr-2011
      Comp3Z04-jun-2011
      Comp3X01-oct-2011
      Comp3Z01-dec-2011

       

       

      • I want to display the data as below, that is the data from table1 should be derived to table2 as shown below
      • Where the rating system is that when even a company is given a rating symbol of 'Z' than that is rating is called a Default rating and
      • I need to get the rating before the company that has been defaulted that rating before the 'Z' rating

       

      Table2

      CompanyRating before defaultDate of Rating before defaultDate of Default regconition
      Comp1YY01-feb-201101-mar-2011
      Comp2XXX02-feb-201103-sep-2011
      Comp3YY01-apr-201104-jun-2011
      Comp3X01-oct-201101-dec-2011

       

      Thanks in advance