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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
stevejones1
Contributor III
Contributor III

Previous Quarter

Hi

I need to create 2 variables to get the Max Quarter and the previous quarter

MY EXPRESSION :

(Max Quarter - Previous Quarter)

/Previous Quarter

i am able to get max quarter by using =MaxString(YrQtr) but cannot get previous quarter

Please find the attached app

Thanks

1 Solution

Accepted Solutions
stevejones1
Contributor III
Contributor III
Author

easy solution 🙂

View solution in original post

16 Replies
Digvijay_Singh

Something like this -

QuarterStart(Max(Date),-1)

stevejones1
Contributor III
Contributor III
Author

My dates are based off of Fiscal calendar , and this is not giving me the right quarter , i expect FY18-Q4 for previous quarter

Digvijay_Singh

I think you can adjust according to Fiscal calendar with the help of 3rd parameter -

QuarterStart(date[, period_no[, first_month_of_year]])


first_month_of_yearIf you want to work with (fiscal) years not starting in January, indicate a value between 2 and 12 in first_month_of_year.

https://help.qlik.com/en-US/sense/February2018/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions...

stevejones1
Contributor III
Contributor III
Author

I want to see FY18-Q4 as the previous quarter value.is that possible?

Digvijay_Singh

You mean the value as 'FY18-Q4'? or the date type date for the first day of Quarter 4 2018. Can you share some sample data and expected output?

stevejones1
Contributor III
Contributor III
Author

Attaching my application. !

Digvijay_Singh

I cannot open qvw, its unfortunate Qlik doesn't allow to open qvw with personal edition. Hopefully someone having license would help.

Digvijay_Singh

may be this can work if Maxstring worked for you to get 2nd highest-

MaxString(YrQtr,2)

stevejones1
Contributor III
Contributor III
Author

unfortunately no, i get an error msg saying maxstring takes only 1 parameter