Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
airobles
Contributor II
Contributor II

Change Format Date Text to Number / Cambio Formato Fecha Texto a Número

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,

1 Solution

Accepted Solutions
Digvijay_Singh

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


View solution in original post

4 Replies
Digvijay_Singh

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


airobles
Contributor II
Contributor II
Author

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.

MarcoWedel

Hi,

another solution might be;

QlikCommunity_Thread_294558_Pic1.JPG

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

airobles
Contributor II
Contributor II
Author

Tanks Marco!