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: 
Not applicable

Mapping months in difeerent formats

Hi All,    - I have three sets of data. In the first two sets the month is in character format for eg (JAN,FEB...etc) but in the third one its in numeric format like (01,02,03). I want to bring the format of the first two data sets like the third one ie in the numeric one. I tried the mapping function its not working. Its not synchronizing with the other two. Need help!- Thanks Anirban

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Mapping is the obvious answer here so maybe you're doing it slightly wrong?

Map_Months:

MAPPING LOAD * INLINE [

In,Out

JAN,01

FEB,02

MAR,03

APR,04

etc

];

Data:

LOAD

   Field1,

   Field2,

   Etc,

   ApplyMap('Map_Months',TRIM(UPPER(Month))) AS Month

FROM....;

You can you use this in all three data loads as when the third one doesn't match any map values it will return the current value - which is correct in the third data set.

Hope this helps,

Jason

View solution in original post

4 Replies
Not applicable
Author

Hi anirban86,
I think you can use some like this:
num(month(DateOrder))
BR
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Mapping is the obvious answer here so maybe you're doing it slightly wrong?

Map_Months:

MAPPING LOAD * INLINE [

In,Out

JAN,01

FEB,02

MAR,03

APR,04

etc

];

Data:

LOAD

   Field1,

   Field2,

   Etc,

   ApplyMap('Map_Months',TRIM(UPPER(Month))) AS Month

FROM....;

You can you use this in all three data loads as when the third one doesn't match any map values it will return the current value - which is correct in the third data set.

Hope this helps,

Jason

v_iyyappan
Specialist
Specialist

Hi,

     Use the Script like this

         Date(Date,'MM') AS Month,

Hope its help

Iyyappan

Not applicable
Author

You can also use following code:

=makedate(Year(DateOrder), num(month(DateOrder)),day(DateOrder))