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: 
prma7799
Master III
Master III

create date with makedate function

Hi All,

How to create date with make date function

I have field months like

April

May

June

July

Aug

Sept

Oct

Nov

Dec

Jan

Feb

Mar

excepted output

01-04-2015

01-05-2015

01-06-2015

01-07-2015

01-08-2015

01-09-2015

01-10-2015

01-11-2015

01-12-2015

01-01-2016

01-02-2016

01-03-2016

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

There are multiple possible solutions, e.g. try something like

MAP:

MAPPING LOAD

Month, Makedate(2015+offset,MonthNum)

INLINE [

Month, MonthNum, offset

April, 4,0

May,5,0

June,6,0

July,7,0

Aug,8,0

Sept,9,0

Oct,10,0

Nov,11,0

Dec,12,0

Jan,1,1

Feb,2,1

Mar,3,1

];

LOAD

     ApplyMap('MAP', YourMonthField, 'No Mapping found') as MonthFieldNew,

     ...

FROM ...;

View solution in original post

7 Replies
rajeshforqlikvi
Creator
Creator

Returns a date calculated from the year YYYY, the month MM and the day DD.

If no month is stated, 1(January) is assumed.

If no day is stated, 1 (the 1:st) is assumed.

Ex:

makedate( 2016, 2, 14 )

returns

2016-02-14

swuehl
MVP
MVP

There are multiple possible solutions, e.g. try something like

MAP:

MAPPING LOAD

Month, Makedate(2015+offset,MonthNum)

INLINE [

Month, MonthNum, offset

April, 4,0

May,5,0

June,6,0

July,7,0

Aug,8,0

Sept,9,0

Oct,10,0

Nov,11,0

Dec,12,0

Jan,1,1

Feb,2,1

Mar,3,1

];

LOAD

     ApplyMap('MAP', YourMonthField, 'No Mapping found') as MonthFieldNew,

     ...

FROM ...;

rajeshforqlikvi
Creator
Creator

Makedate(2015,4,1);

Makedate(2015,5,1)

like this you can create all dates ....

prma7799
Master III
Master III
Author

Hi swuehl‌,

I tried your solution but I am getting date field without months.

see below,

mont.png

Also find script.

sunny_talwar

Try this:

Date(ApplyMap('MAP', Month, 'No Mapping found') ,'dd-MM-yyyy') as t

mm is for minutes and MM is for Months

prma7799
Master III
Master III
Author

Hi sunindia‌,

Now am getting date field in my target fields can we link these to the master calendar

Please look into this how to add excel file into existing data model

tamilarasu
Champion
Champion

Or simply try,

MakeDate(2015,Month(Date#(Left(Month,3),'MMM'))) as Date