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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

create date using quarter and year

can we create date from year and quarter field

18 Replies
Not applicable
Author

this give wrong result pfa

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

LOAD *,

MakeDate(Year, Quarter*3) AS Date

INLINE [

    Year, Quarter

    2015, 1

    2015, 2

    2015, 3

    2015, 4

];

Regards,

Jagan.

MarcoWedel

Looks correct

Which result did you expect?

Regards

Marco

jonathandienst
Partner - Champion III
Partner - Champion III

Well its the correct result if you want the first day of each quarter. So what date do you want?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
settu_periasamy
Master III
Master III

Not applicable
Author

I want all the month

aveeeeeee7en
Specialist III
Specialist III

Hi Try this Script:

MasterCalendar:
LOAD
Date AS CreatedDate,
Month(Date) AS CalendarMonth,
Year(Date) AS CalendarYear,
'Q'&ceil(Month(Date)/3) AS Quarters,
Month(Date) & '-' & Year(Date) AS CalendarMonthAndYear;

LOAD
Date(makedate(2015,1,1)+recno()-1,'DD/MM/YYYY') as Date
Autogenerate makedate(2015,12,31) - makedate(2015,1,1) + 1;

Hope that helps.

Regards

Av7en

qlikviewwizard
Master II
Master II

Hi shweta08,

Please try with jagan  or arulsettu 's advise.

Enclosed the file for your reference.

YrQtr:

LOAD *,

MakeDate(Year, Quarter*3) AS Date

INLINE [

    Year, Quarter

    2015, 1

    2015, 2

    2015, 3

    2015, 4

];

Capture.JPG

jagan
Partner - Champion III
Partner - Champion III

Hi Swetha,

Try this script below

LOAD *,

MakeDate(Year, Quarter*3) AS Date,

SubField(Quarter*3 & '/' & (Quarter*3 - 1) & '/' & (Quarter*3 - 2), '/') AS Month

INLINE [

    Year, Quarter

    2015, 1

    2015, 2

    2015, 3

    2015, 4

];

Regards,

Jagan.