Discussion Board for collaboration on QlikView Scripting.
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 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.
LOAD * Inline [
Year(TransactionDate) as Year,
-YearToDate(TransactionDate,0) as CYTD,
-YearToDate(TransactionDate,-1) as LYTD
Thank you for your help.
But i have not any field with date. i have only yearmonth.