Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day!
in load script i have field YearMonth in format YYYYMM (201507 - July'15)
I need to create in load script such flags:
YTD - must get period from beggining of max year till max YearMonth
YTDPriorYear - the same logic from YTD, but for prior year.
MTD - max YearMonth
MTDPriorYear - the same logic from MTD, but for prior year.
Please, help!
Thanks.
Please find below the script for loading YTD and LYTD in load script.
This is for M/D/YYYY format. Please use date conversion functions to achieve your desired format.
Hope it helps.
Sales:
LOAD * Inline [
TransactionDate,Sales
01/01/2014,100
02/01/2014,200
03/01/2014,900
01/01/2015,300
02/01/2015,400
03/01/2015,300
03/05/2015,400 ];
Temp:
LOAD
TransactionDate,
Year(TransactionDate) as Year,
-YearToDate(TransactionDate,0) as CYTD,
-YearToDate(TransactionDate,-1) as LYTD
Resident Sales;
Thank you for your help.
But i have not any field with date. i have only yearmonth.