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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to derive quarter

I have field myear which contains month number and year can you please help me how to derive quarter,week number with year,Half Year H1,H2 and Year.. the values in  myear are 1-2017,2-2017,3-2017......8-2018,9-2018... From this I need to derive

4 fields Quarter,FY week, FY Year, FY half Year.

Note: my year starts with November instead of January.

Quarter --  Q1-17,Q2-17,Q3-17....Q3-18,Q4-18

FyWeek-- wk1-17,wk2-17,...wk50-18

Fy year--- FY17, FY18

Fy Half Year--- H1-17,H2-17...H2-18

1 Reply
bramkn
Partner - Specialist
Partner - Specialist

To get the month and year use:

subfield(myear, '-',1) for monthnr

subfield(myear, '-',2) for yearnr


The quarter can be done by deviding the months by 4 and do a ceil so: ceil(year/4)

for the half year you can get it by combining the first and last 2 quarters. Can be done a lot of other ways but this is one of them.

If you only have the month and year it will be impossible to determine which week it is. You can only get a week range but you don't say you want that and it would be pretty useless I guess.

I guess I covered it all not sure. its early