Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
mihai_iov
Contributor II

Get the month from dates

I have a column with dates in the format 'DD-MM-YY'.
How can I get the value of the month, in a loading script?

I need to create a separate column in which I have to assign every date a month name.
Long story short, assuming I got a table column with the date in the mentioned format, how can I get the output below?

DateMonth
10-01-17January
20-02-17February
15-03-17March
11-04-17April
14-05-17May
20-06-17June
19-07-17July
18-08-17August
28-09-17September
28-10-17October
26-11-17November
23-12-17December
1 Solution

Accepted Solutions
MVP
MVP

Re: Get the month from dates

Set DateFormat ='DD-MM-YY';

LOAD Date,

          Month(Date) as ShortMonth,

          Text(Date(Date, 'MMMM')) as LongMonth

FROM ...;

edit:

or

...

  Dual(Date(Date, 'MMMM'),Month(Date) ) as LongMonth


to keep the numerical month number in long format, too

4 Replies
MVP
MVP

Re: Get the month from dates

Set DateFormat ='DD-MM-YY';

LOAD Date,

          Month(Date) as ShortMonth,

          Text(Date(Date, 'MMMM')) as LongMonth

FROM ...;

edit:

or

...

  Dual(Date(Date, 'MMMM'),Month(Date) ) as LongMonth


to keep the numerical month number in long format, too

Chanty4u
Esteemed Contributor III

Re: Get the month from dates

try this

Test:

LOAD * , date(Date#(Date,'DD-MM-YYYY'),'MMMM')  as Rebate_New;

LOAD * Inline [

Date

10-01-17

];

mihai_iov
Contributor II

Re: Get the month from dates

Thanks! That's it

Chanty4u
Esteemed Contributor III

Re: Get the month from dates

great:) please close the thread by making correct and helpful answer:)