Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
daya
New Contributor II

How to show more than 4 quarters if i select date range from 01-04-2017 to 31-03-2019 ?

I want to show quarter based on date range selection.

if i select date range from 01-04-2017 to 31-03-2018 then

quarters = Q1,Q2,Q3,Q4


if i select date range from 01-04-2017 to 31-03-2019 then

quarters = Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8

Labels (1)
2 Replies
Partner
Partner

Re: How to show more than 4 quarters if i select date range from 01-04-2017 to 31-03-2019 ?

Hi,

I know what you are getting at, but there are no Q5 till Qn. There are only four quarters. What you can make is a quarter sequence number. Meaning that every quarter from each year has his own identifier. Then you will get something like you requested.

Jordy

Climber

Work smarter, not harder
vikasmahajan
Esteemed Contributor

Re: How to show more than 4 quarters if i select date range from 01-04-2017 to 31-03-2019 ?

Hi ,

Based on min & max date create a master calendar & link this master calendar with transactions with follow cal code

 

"date" AS %Date,
YearName("date",0,4) AS FinancialYear,
Date(Yearstart("date",0,4)) AS YearStart,
Date(Yearend("date",0,4)) AS YearEnd,
Num(Date(Yearstart("date",0,4),'YYYY')) AS FinancialYearNo,
date(MonthStart("date"),'MMM-YY') AS MonthYear,
Month("date") AS MonthName,
If(Num(Month("date"))>3,Num(Month("date"))-3,Num(Month("date"))+9) AS MonthNumber,
MonthStart("date") AS MonthStart,
MonthEnd("date") AS MonthEnd,
Year("date") AS Year,
'Q' & alt(if(Month("date")<4,4),if(Month("date")<7,1),if(Month("date")<10,2),3) AS Quarter,
alt(if(Month("date")<4,4),if(Month("date")<7,1),if(Month("date")<10,2),3) as QTR,
'Q' & alt(if(Month("date")<4,4),if(Month("date")<7,1),if(Month("date")<10,2),3) & '-' & Year("date") as QuarterYear,
quarterstart("date",0,4) AS QuarterStart,
quarterend("date",0,4) AS QuarterEnd,
quartername("date",0,4) AS QuarterName,
if(Num(Month("date"))>3,Year("date")+1,Year("date")) AS FiscalYear,
AutoNumber(Month("date") & Year("date")) AS Sequential,
NUM("date") AS DateNum,
monthname("date") AS CalMonthYear,
Day("date") &'-'& Date("date",'MMM') AS DayMon,
num(Year("date")&num(Month("date"),'00')) as YEAR_MONTH, // Link between tables for previous month / year selection
num((Year("date")-1)&num(Month("date"),'00')) AS YEAR_MONTH_PREVIOUS, // Link between tables for previous month / year selection
num((Year("date")-2)&num(Month("date"),'00')) AS P_YEAR_MONTH_PREVIOUS,
Day(Monthend("date")) AS NumberOfDaysInMonth,
ceil(QuarterEnd("date")-QuarterStart("date")) AS NumberOfDaysInQtr,
Date(Yearend("date",0,4)) - Date(Yearstart("date",0,4)) as NumberOfDaysInYr,
if( YearName("date",0,4)='2017-2018',1,0) as YearFlag