Hi Abhilash,
Sorry for giving wrong example, below is the correct example.
Transaction | type | date | amount | required results |
---|---|---|---|---|
101 | aaa | 01/01/2010 | 5678 | 5678 |
101 | aaa | 01/10/2011 | 5464 | 5464 |
101 | def | 05/08/2010 | 9876 | 9876 |
101 | dez | 01/01/2009 | 5656 | 0 |
101 | dex | 05/01/2011 | 7658 | 7658 |
102 | aaa | 01/10/2011 | 6785 | 6785 |
102 | aaa | 01/01/2009 | 4567 | 4567 |
102 | xdw | 11/12/2008 | 3234 | 0 |
102 | dfe | 10/12/2010 | 2123 | 2123 |
102 | xsd | 03/12/2011 | 4563 | 4563 |
Transaction Group--- > Typegroup--> from this type group I need to pickup minimum date for type='aaa' and within Transaction group if any date is less than this date then amount should be zero.
Here 101 Transaction gruop--01/01/2010 is minimum date for type group and within same Transaction group 01/01/2009 is less than 01/01/2010 so, amount is zero.
Like wise second Transaction group 102
Thanks for understanding,
Sastry