Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I need to change strings that have month names such as January, February to show month number (1,2, etc.) how can I do this?
is it only a string or does it Show the dual part of a date function?
if it is only a string, I would use an inline mapping table
MapMonth:
mapping load * Inline [
January, 1
february, 2
..
]
Data:
load abc,
applymap('MapMonth, yourmonthstring) as Monthnr
..
the best way would be to use a mastercalendar
Use Month() function
Hi Create a Inline load table as
Load * Inline [
Month, MonthNo
January, 1
February, 2
March,3
April, 4
May,5
June, 6
July,7
August,8
September,9
October,10
November,11
December,12
];
Try to associate this table with the original table which contains month column
Or even , if the Month contains strings
Match(<FieldName, 'January' .......' December') as MonthNo
Write all MonthNames above
is it only a string or does it Show the dual part of a date function?
if it is only a string, I would use an inline mapping table
MapMonth:
mapping load * Inline [
January, 1
february, 2
..
]
Data:
load abc,
applymap('MapMonth, yourmonthstring) as Monthnr
..
the best way would be to use a mastercalendar
Hi,
try: num(Month(FieldName))