Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
How do I get the month function to accept only the month number when loading in data?
Here is part of my script:
Map_Months:
MAPPING LOAD * INLINE [
In,Out
Jan,01
Feb,02
Mar,03
Apr,04
May,05
Jun,06
Jul,07
Aug,08
Sep,09
Oct,10
Nov,11
Dec,12
];
Table1:
LOAD Month(ApplyMap('Map_Months',Month)) AS Month
Try without the Month() function
Table1:
LOAD ApplyMap('Map_Months', Month) as Month
or this
Table1:
LOAD ApplyMap('Map_Months', Month(Date#(Month, 'MMM'))) as Month
Try without the Month() function
Table1:
LOAD ApplyMap('Map_Months', Month) as Month
or this
Table1:
LOAD ApplyMap('Map_Months', Month(Date#(Month, 'MMM'))) as Month
It looks like you are specifying two columns. One with an abbreviation of the month name "In" and one with a number called "Out".
I don't think you need the mapping load, unless there is another reason for it.
I removed the mapping load and ApplyMap function and it loaded fine based on the inline data.
Map_Months:
LOAD * INLINE [
In,Out
Jan,01
Feb,02
Mar,03
Apr,04
May,05
Jun,06
Jul,07
Aug,08
Sep,09
Oct,10
Nov,11
Dec,12
];
Table1:
LOAD dual(Month('Map_Months')) AS Month