Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

how to make quarter in master calender

Pls help for below

how to make quarter in master calender

5 Replies
Not applicable

hI Abhay,

Try this,

Calendar:

Load

if(num(Month(DateField)) > 6 ,(Year(DateField) + 1),Year(DateField)) AS FIN_YEAR ,

if(num(month(DateField))>=1 and num(month(DateField))<=3,'Q4',

if(num(month(DateField))>=4 and num(month(DateField))<=6,'Q1',

if(num(month(DateField))>=7 and num(month(DateField))<=9,'Q2',

if(num(month(DateField))>=10 and num(month(DateField))<=12,'Q3')))) as FinancialQuarter

From Source;

Siva_Sankar
Master II
Master II

Hi,

You can first define the startdate and enddate from your existing date field and then use forllowing script to create master calendar.After that link both Open_time and orig date to this calendar.Hope this will help.

LET varMinDate = StartDate; eg:'6/15/2001'

LET varMaxDate = EndDate; eg: Today();

//************TempCalendar***********

TempCalendar:

LOAD

$(varMinDate) + rowno() - 1 AS DateNumber,

date ($(varMinDate) + rowno() - 1) AS TempDate

AUTOGENERATE

$(varMaxDate) - $(varMinDate) + 1;

//*************Master Calendar************

MasterCalendar:

LOAD

TempDate AS Date,

Week (TempDate) AS Week,

Year (TempDate) AS Year,

Month (TempDate) AS Month,

Day (TempDate) AS Day,

Weekday (TempDate) AS WeekDay,

'Q' & Ceil(Month (TempDate)/3) AS Quarter,

Date( Monthstart (TempDate), 'MMM-YYYY') AS MonthYear,

Week (TempDate) & '-' & Year (TempDate) AS WeekYear

Resident TempCalendar

Order by TempDate ASC;

Drop Table TempCalendar;

MayilVahanan

Hi

Try like this

'Q' & Ceil(Month (DateField)/3) AS Quarter

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

Hi Abhay,

Try this:

'Q' & Ceil(Month (Date)/3)  as Date_Quarter


Thanks,
AS

MK_QSL
MVP
MVP

'Q' & Ceil(Month (Date)/3) as Quarter,