Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I need to display last quarter and current year in a text box Q2 - 2016

Hi Guys,

I need to display last quarter and current year in a text box Q2 - 2016 via script or an expression.

Regards

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

the same if you want as Q2-2016

='Q' & ceil(month(AddMonths(today(),-3)))/3 &'-' & year(addmonths(today(),-3))

View solution in original post

7 Replies
sunny_talwar

May be this:

=MaxString(Quarter) & ' - ' & Max(Year)

Anonymous
Not applicable
Author

No that hasn't worked.

Plus, when I'm in Q1 - 2017 current quarter year, the report will be Q4 - 2016

Anonymous
Not applicable
Author

this Expression =QuarterName(AddMonths(today(),-3)) 

will get you

in first quarter of 2017 you will get Oct-Dec 2017

Anonymous
Not applicable
Author

I know that Rudolf, but I want it to be displayed Q1, Q2, Q3,Q4, God knows why QV does it like Jan - Mar when the whole world uses Q1.

Thanks for the second part of the question, just need to include the Q1 BIT.

Anonymous
Not applicable
Author

the same if you want as Q2-2016

='Q' & ceil(month(AddMonths(today(),-3)))/3 &'-' & year(addmonths(today(),-3))

Anonymous
Not applicable
Author

Cheers, spot on.

sunny_talwar

My bad, this would have worked

=MaxString({<Year = {"$(=Max(Year))"}>}Quarter) & ' - ' & Max(Year)