Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
riyazasma1009
Creator
Creator

Issue with MakeDate function

Hi All,

I am using MakeDate() function as present in the below script:

Tab1:
LOAD *,
Second(Time) as TimeSec,
Minute(Time) as TimeMin,
Hour(Time) as TimeHour,
date(MakeDate(Day,Month,Year),'DD-MM-YYYY') as MakeDateTemp,

LOAD * INLINE [
ID, Time, Date, Day, Month, Year
1, 09:45, 19-03-2016, 20, 05, 1990
2, 12:32:50, 10-05-2016, 10, 10, 2000
3, 04:55:55, 04-04-2015, 20, 12, 2012
4, 01:23:45, 22-09-2015, 15, 05, 2013
5, 06:07:32, 26-05-2015, 21, 01, 1995
6, 05:04:56, 24-07-2015, 30, 08, 2015
7, 03:45:55, 09-10-2015, 27, 09, 2014
8, 10:10:10, 04-08-2015, 23, 03, 2003
9, 18:32:45, 05-05-2015, 10, 05, 2015
10, 10:09:55, 10-10-2016, 19, 03, 2015
11, 0.555555, 20-10-2015, 12, 12, 2000
12, 7.45, 13-3-2015, 26, 10, 2005
13, 13:14:15, 01-01-2016, 24, 09, 2004
14, 10:10:10, 01-01-2015, 23, 12, 2013
15, 09:07:45, 12/10/2015 29, 10, 2000
]
;

After running the script, MakeDatetemp field returns null values.

Could anyone please explain me as to what is wrong in my code?

Thanks,

Asma

1 Solution

Accepted Solutions
avinashelite

The right format  is like this

date(MakeDate(Year,Month,Day),'DD-MM-YYYY') as MakeDateTemp,



MAKEDATE() will take parameters in particular order ...i.e. Year,Month and Day

View solution in original post

7 Replies
Anonymous
Not applicable

marcus_sommer

The order of the makedate is wrong - it needs to be: makedate(year, month, day).

- Marcus

jonathandienst
Partner - Champion III
Partner - Champion III

The Makedate parameters are

MakeDate(Year, Month, Day) and not MakeDate(Day, Month, Year)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
avinashelite

The right format  is like this

date(MakeDate(Year,Month,Day),'DD-MM-YYYY') as MakeDateTemp,



MAKEDATE() will take parameters in particular order ...i.e. Year,Month and Day

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

LOAD *,

Second(Time) as TimeSec,

Minute(Time) as TimeMin,

Hour(Time) as TimeHour,

date(MakeDate(Year, Month, Day),'DD-MM-YYYY') as MakeDateTemp

INLINE [

ID, Time, Date, Day, Month, Year

1, 09:45, 19-03-2016, 20, 05, 1990

2, 12:32:50, 10-05-2016, 10, 10, 2000

3, 04:55:55, 04-04-2015, 20, 12, 2012

4, 01:23:45, 22-09-2015, 15, 05, 2013

5, 06:07:32, 26-05-2015, 21, 01, 1995

6, 05:04:56, 24-07-2015, 30, 08, 2015

7, 03:45:55, 09-10-2015, 27, 09, 2014

8, 10:10:10, 04-08-2015, 23, 03, 2003

9, 18:32:45, 05-05-2015, 10, 05, 2015

10, 10:09:55, 10-10-2016, 19, 03, 2015

11, 0.555555, 20-10-2015, 12, 12, 2000

12, 7.45, 13-3-2015, 26, 10, 2005

13, 13:14:15, 01-01-2016, 24, 09, 2004

14, 10:10:10, 01-01-2015, 23, 12, 2013

15, 09:07:45, 12/10/2015 29, 10, 2000

];

Use this statement:

date(MakeDate(Year, Month, Day),'DD-MM-YYYY') as MakeDateTemp

Anonymous
Not applicable

use this (Change order of fields)

makedate(year,month,day)

riyazasma1009
Creator
Creator
Author

Thanks a lot everyone for the quick response...