Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How to get latest 5 years data dynamically. how to restrict in script.
Regards,
krishna
Hi,
do you have some date_field?
Then you can use the Month() and Year() functions to construct other dimensions out of that.
You can then use a WHERE() clause with some expression based on that (like >> Year(date) >= Year(Today())-5 <<
HTH
Hi,
Write
Where Year(dateField)> AddYear(Year(Today()),-5)
Regards,
Simply u can use this in end of ur table name in ur script:
Where Year(NOW())-5
where YEAR(Today())-5;
Hi,
Try like this type of script.
A:
LOAD * INLINE [
Year, Sales, Category
2015, 50000, A
2014, 60000, A
2013, 30000, A
2012, 25000, A
2015, 70000, B
2014, 80000, B
2013, 30000, B
2012, 95000, B
2015, 50000, C
2014, 70000, C
2013, 30000, C
2012, 35000, C
];
temp:
LOAD
Year(Today())-3 as yr
Resident A;
Hi Krishna
Try this, i use it my self;
where DATEFIELD >= (num(Today())-1825) // 5 year back from current day
This way you will have a full set of data going back 5 years all time.
Best regards,
Teis