Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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_michaelid
Honored Contributor II

Mapping months in difeerent formats

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

4 Replies
Not applicable

Re: Mapping months in difeerent formats

Hi anirban86,
I think you can use some like this:
num(month(DateOrder))
BR
jason_michaelid
Honored Contributor II

Mapping months in difeerent formats

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
Valued Contributor

Re: Mapping months in difeerent formats

Hi,

     Use the Script like this

         Date(Date,'MM') AS Month,

Hope its help

Iyyappan

Not applicable

Re: Mapping months in difeerent formats

You can also use following code:

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