Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts
I would like to load data, but only data from last year until the current date. This is my expression:
resident job where Jahr = 2013 group by prodnr;
How would I habe to script this?
Thank you very much for your help!
Jan
LOAD 1,
*
RESIDENT job
WHERE Jahr>=ADDMONTHS(YEARSTART(Now()),-12) ;
Should work it would be better to base it on a date field rather than year.
hm, somehow this expression did not work for me...
If it has to be the beginning of last year (jan 1st) until today , you can't use a YEAR field in the filter, you have to use a Date field from your source . Assuming your date field is called 'Date' it will be something like this:
WHERE Date >= YearStart( AddYears( Today(), -1 )) and Date <= Today()
This will make sure your date is between "the first date of the year for today's date in the previous year" and "today's date"
Or if you don't have any dates > today in your data
LOAD 1,
*
RESIDENT job
WHERE Jahr>= Year( AddYears(Today(),-1) ) ;