Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to convert a Month, Year and day into a date

Hi guys,

My script has three fields: A month, day and Year. What I would like to do is to convert it into one variable called Date.

Does anyone have an idea?

I have used "Date(day&'/'&Month&'/'&Year) as Date"  and it is not working properly.

Thanks in advance.

1 Solution

Accepted Solutions
sunny_talwar

Try the MakeDate() function

MakeDate(Year, Month, Day) as Date


UPDATE: In case Month is a text (Jan, Feb, Mar, .... etc), you can try this:

MakeDate(Year, Month(Date#(Month, 'MMM')), Day) as Date

View solution in original post

7 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Use,

Makedate(Year,Mont,Date) as Date

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
MayilVahanan

Hi

Try like this

MakeDate(Year, Month, Day)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sunny_talwar

Try the MakeDate() function

MakeDate(Year, Month, Day) as Date


UPDATE: In case Month is a text (Jan, Feb, Mar, .... etc), you can try this:

MakeDate(Year, Month(Date#(Month, 'MMM')), Day) as Date

arulsettu
Master III
Master III

may be this

makedate(Year,month) as Date

MayilVahanan

Hi

Suppose, if the Month is in Text, then try like this

MakeDate(Year, Month((Date#(Month, 'MMM'))), Day)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
avinashelite

As all suggested use the makedate() function

MakeDate(Year, Month, Date) .....you need to keep the order of the inputs ..that is anything placed as 1 argument will be taken as the  Year ,,2nd as the month ....and 3 as the date ...

if you give only year than the month and date will be defaulted to 01 &01

Anonymous
Not applicable
Author

Thanks Sunny.

Script was giving 0 values because Month variable was in text format.

Now it is working well.