Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a source, where date is formatted in month and year columns:
I want to convert it to MM.YYYY format and use it as Time dimension in charts etc.
I already tried this function: DATE (MakeDate(MONTH('month'),YEAR('year')),'MM.YYYY') as date2,
but did not solve the problem. After load, new field date2 just shows '-'
Perhaps it is conflicted with my SET statements:
SET DateFormat='DD.MM.YYYY';
SET FirstWeekDay=0;
SET FirstMonthOfYear=1;
Hi
TMP:
LOAD *, DATE(MakeDate(year,month),'MM.YYYY') AS MY_DATE,
;
LOAD * Inline
[
year,month
2018,3
2018,5
2017,11
2018,7
2018,3
2017,11
2017,11
2018,7
];
EXIT SCRIPT;
Year is the first argument for the MAKEDATE function.
From QV Help:
Syntax:
MakeDate(YYYY [ , MM [ , DD ] ])
Return data type: dual
Arguments:
Argument | Description |
---|---|
YYYY | The year as an integer. |
MM | The month as an integer. If no month is stated, 1 (January) is assumed. |
DD | The day as an integer. If no day is stated, 1 (the 1st) is assumed. |
Hi
TMP:
LOAD *, DATE(MakeDate(year,month),'MM.YYYY') AS MY_DATE,
;
LOAD * Inline
[
year,month
2018,3
2018,5
2017,11
2018,7
2018,3
2017,11
2017,11
2018,7
];
EXIT SCRIPT;
Thank you, MakeDate in the right order with Inline load worked perfectly!
Try changing your expression to Date(MonthEnd(makedate(2018,3)),'MM.YYYY')