Discussion board where members can get started with QlikView.
I need to know how quarters in a year will be calculated based on current date time and also based on date field from my database.
If I have a field of type date and need to calculate Quarters (Suppose Q1, Q2, Q3 and Q4), then how to do that thing?
try tis in ur script Date/calendar table.
'Q' & Ceil(Month([Order Date])/3) As Quarterly,
=Num(Ceil( Month(MyDate)/ 3 ), 'Q0')
use some thing like below as Mapping table :
rowno() as Month,
'Q' & Ceil (rowno()/3) as Quarter
HI Try This
TempDate AS DATE,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
date(monthstart(TempDate), 'MMM-YYYY') as MonthYear,
ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter,
Year(TempDate) & ' ' & ApplyMap('QuartersMap', month(TempDate), Null()) as CalendarYearQuarter,
RIGHT(Year(TempDate) & ' ' & ApplyMap('QuartersMap', month(TempDate), Null()), 2) AS CalendarQuarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay
Order By TempDate ASC;
Drop Table TempCalendar;