Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
I have the following problem
How can I change the Format of a month, from Text to Number from the Load? I need it to be able to create the Weekday. Since in the loading file I have the three elements separated and the month arrives in text format.
Example:
JANUARY = 01
FEBRUARY = 02,
MARCH = 03
Thank you,
Note: Translation added by Community Moderator as a courtesy. Please use English in main forums.
- - -
Hola ,
Tengo el siguiente problema.
Como puedo cambiar el Formato de un mes, de Texto a Número desde el Load? Lo necesito para poder crear el Weekday. Ya que en el archivo de carga tengo los tres elementos separados y el mes llega en formato texto.
Ejemplo:
JANUARY = 01
FEBRUARY = 02,
MARCH = 03
Gracias,
Do you mean you are receiving Month as 'JANUARY'? from your source?
You can have mapping table like this -
Map_Table:
Mapping Load
* inline [
MonthText,MonthNo
JANUARY,01
FEBRUARY ,02
...
...
...
];
Now in your load statement you can use Apply Map as
Applymap('Map_Table',YourMonthfield,'NA') as MonthNum
Do you mean you are receiving Month as 'JANUARY'? from your source?
You can have mapping table like this -
Map_Table:
Mapping Load
* inline [
MonthText,MonthNo
JANUARY,01
FEBRUARY ,02
...
...
...
];
Now in your load statement you can use Apply Map as
Applymap('Map_Table',YourMonthfield,'NA') as MonthNum
Tanks Singh ! ,
It worked as wanted. now the field I can handle it
///
LOAD
MAKEDATE("[TIME].[TIME].[CALENDARYEAR].[MEMBER_CAPTION]",
Applymap('Map_Table',"[TIME].[TIME].[MONTHNUMBEROFYEAR].[MEMBER_CAPTION]",'NA'),
"[TIME].[TIME].[DAYNUMBEROFMONTH].[MEMBER_CAPTION]")
AS PERIODO,
///
Regards.
Hi,
another solution might be;
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
table1:
LOAD *,
Num(Month(Date#(MonthText,'MMMM')),'00') as Month
INLINE [
MonthText
JANUARY
FEBRUARY
MARCH
];
hope this helps
regards
Marco
Tanks Marco!