Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi i have one field,in that i want max five .
Load * Inline [
Year |
2007 |
2008 |
2009 |
2010 |
2011 |
2012 |
2013 |
2014 |
2015 |
2016 |
2017 |
] ;
Output :
2013 |
2014 |
2015 |
2016 |
2017 |
If i enter to next year i.e 2018 my output should be
2014 |
2015 |
2016 |
2017 2018 |
How to gyt this ?
May be this:
Table:
Load * Inline [
Year
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
];
Right Join
LOAD Max5 + IterNo() as Year
While Max5 + IterNo() <= Max;
LOAD Max(Year) as Max,
Max(Year) -5 as Max5
Resident Table;
Temp:
Load * Inline [
Year
2007
2008
2010
2009
2011
2012
2013
2014
2015
2016
2017
] ;
Temp1:
Load *,
RecNo() as Record
Resident Temp
order by Year desc;
drop table Temp;
Final:
Load Year
where Record < 6;
Load *
Resident Temp1;
Drop table Temp1;
But my year should give all years and i want one more field with max five years with link to my year field