Discussion Board for collaboration on QlikView Management.
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
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 ...;
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
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 ...;
Makedate(2015,4,1);
Makedate(2015,5,1)
like this you can create all dates ....
Hi swuehl,
I tried your solution but I am getting date field without months.
see below,
Also find script.
Try this:
Date(ApplyMap('MAP', Month, 'No Mapping found') ,'dd-MM-yyyy') as t
mm is for minutes and MM is for Months
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
Or simply try,
MakeDate(2015,Month(Date#(Left(Month,3),'MMM'))) as Date