Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm looking to add a finacial quarter description to my master calendar. For example fin yr 2014 starts on the 31/03/2013, I would like to add Q1 to this but most of the shifts in the quarter functions only take you to first day of each month.
For example Quartername('31/03/2013' , 4) gives a description of Jan - Mar 2013, when really I want it to be Apr - Jun 2013.
I could create my own inline view and use intervalmatch but was wondering if there is Qlikview syntax that can handle this ?
Many thanks
HI
Try like this
Load *,
'Q'&If(Month(QuarterStart(Date))='1',4,Div(Month(QuarterStart(Date)),3)) as Quarter
from tablename;
Q1->apr,may,jun
Q2->jul,aug,sep
..
Hope it helps
You can use as
=Quartername(Date#('01/04/2013','DD/MM/YYYY') , 0,4)
From help
QuarterName(date [, shift = 0 [, first_month_of_year = 1]])
Returns a display value showing the months of the quarter (formatted according to the MonthNames script variable) and year with an underlying numeric value corresponding to a timestamp with the first millisecond of the first date of the quarter. Shift is an integer, where the value 0 indicates the quarter which contains date. Negative values in shift indicate preceding quarters and positive values indicate succeeding quarters. If you want to work with (fiscal) years not starting in January, indicate a value between 2 and 12 in first_month_of_year.