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: 
kalyandg
Partner - Creator III
Partner - Creator III

How to get Date from Year and Month field

hi,

                  i am a beginner, doing projects, i have a doubt, how can we extract date from year/month field in script. Please explain it in briefed script

1 Solution

Accepted Solutions
Not applicable

Hi

try this

MakeDate(year(Expected_Decision_Date),month(Expected_Decision_Date)) as monthyear

View solution in original post

8 Replies
its_anandrjs
Champion III
Champion III

Hi,

Use makedate( ) function

Regards,

Anand

kalyandg
Partner - Creator III
Partner - Creator III
Author

hi anand,

                      Thanks for ur reply, please explain how can i use makedate(), as script

Not applicable

Hi Kalyan,

You can use functions like Month, Year.

Suppose your InvDate = 11/15/2012

for Month=======Month(InvDate) as InMon

for Year========Year(InvYear) as InvYear

Incase you dates are Strings in your QVD, you would have to do an Substring to extract the year and months.

Kidnly post an sample data file, will be able to help better.,

You can refer to the QVW file I attached in the previous post for your query for Average sales. It has the functions.

Regards

Fahad

kalyandg
Partner - Creator III
Partner - Creator III
Author

hi fahad,

                   Thanks for ur reply, i know that we can make year and month from date field given in the table, but i have a data only for year and month, i have to extract date from those fields

Not applicable

Hi

try this

MakeDate(year(Expected_Decision_Date),month(Expected_Decision_Date)) as monthyear

Not applicable

as what anand mention, use makedate()

when loading your data.. let us say:

LOAD Year,

          Month,

          makedate(Year) as Date1

FROM

...

this will create a date for Date1. e.g: let us say your year is 2012, output is 1/1/2012

its_anandrjs
Champion III
Champion III

Hi,

Write in script like

With year your field

Makedate(Year) as Date

HTH

Regards,

Anand

kalyandg
Partner - Creator III
Partner - Creator III
Author

hi,

 

     Thanks for your reply, i get the date as 1/1/2012, but i have year field for two years(2011, 2012) i should get 1/1/2011 to 1/12/2012. please help me to solve this prob