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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
benjamins
Partner - Creator
Partner - Creator

Howto make a variable to calculate quarters regarding year changes?

So I have the following variable definition:

var1:     =Year(today())&ceil(month(today())/3)

Using this variable I get '20143', which is what I expect.

When I subtract something from this number like 1, to get the last quarter I now currently get '20142', which is fine now, but will fail from January to March each year. For example in January 2015 I'd want to get '20144' as a result, but I will get '20150'.

What would be the correct way to go about that? I also want to be able to subtract any other integer to get the appropriate quarter.

10 Replies
Anonymous
Not applicable

Thanks Marcus.