cancel
Showing results for
Did you mean:
Contributor III

## Get Previous Quarter

Hi Guys,

TYQUARTER

 2015-Q1 2015-Q2 2015-Q3 2015-Q4 2016-Q1 2016-Q2 2016-Q3 2016-Q4 2017-Q1 2017-Q2

=Subfield(MaxString(TYQUARTER),'-',2) --> With this i get max Quarter, but i would also need Previous Quarter.

Regards,

Ravi

1 Solution

Accepted Solutions
MVP

I would suggest using The As-Of Table‌ or creating a numeric field which can be used to go back a quarter... may be something like this

AutoNumber(TYQUARTER) as QuarterNum

Resident ....

Order By TYQUARTER;

and then you can use this for prev. quarter

{<QuarterNum = {"\$(=Max(QuarterNum) - 1)"}>}

5 Replies
MVP

I would suggest using The As-Of Table‌ or creating a numeric field which can be used to go back a quarter... may be something like this

AutoNumber(TYQUARTER) as QuarterNum

Resident ....

Order By TYQUARTER;

and then you can use this for prev. quarter

{<QuarterNum = {"\$(=Max(QuarterNum) - 1)"}>}

Contributor III
Author

Hi Sunny,

Thanks for the Reply. I am able to derive the Previous Quarter but not exactly what i was looking.

Plz have a look at below image.I am looking for last column calculation.

!

MVP

Images don't really help Ravi... can you share your app and point out what isn't working? Also, it would be helpful if you can mention what your desired output is.

Best,

Sunny

Contributor III
Author

Hi Sunny,

This is what i am looking for.

 2017 -Q2 MAX Quarter Always - Present Quarter 2016-Q2 Corresponding Quarter of Previous Year from the above 2017-Q1 Also need last Quarter (Max Quarter - 1) Y/Y % 2017Q2-2016Q2/2016Q2 Q/Q % 2017Q2-2017Q1/2017Q1

I have data some thing like this..All these are string columns.

 TYYEAR TYMONTH TYQUARTER FY2014 FY2016-01 2015-Q1 FY2015 FY2016-02 2015-Q2 FY2016 FY2016-03 2015-Q3 FY2017 FY2015-01 2015-Q4

TO GET Subsequent Quarter of Previous Year

=(SubField( MaxString(TYQUARTER),'-',1)-1) & '-' & SubField( MaxString(TYQUARTER),'-',2)

Max Quarter

=MaxString(TYQUARTER)

=(SubField( MaxString(TYQUARTER),'-',1)-1) & '-' & SubField( MaxString(TYQUARTER),'-',2)

I am stuck to get the previous quarter based on my Max Quarter.

If Q2 2017 is Present - Q1 2017 Previous

IF Q3 2017- Present - Q2 2017 Previous

IF Q1 2017 Present - Q4 2016 Previous

Regards,

Ravi

Contributor III
Author

This is what i am looking for.

 2017 -Q2 MAX Quarter Always - Present Quarter 2016-Q2 Corresponding Quarter of Previous Year from the above 2017-Q1 Also need last Quarter (Max Quarter - 1) Y/Y % 2017Q2-2016Q2/2016Q2 Q/Q % 2017Q2-2017Q1/2017Q1

I have data some thing like this..All these are string columns.

 TYYEAR TYMONTH TYQUARTER FY2014 FY2016-01 2015-Q1 FY2015 FY2016-02 2015-Q2 FY2016 FY2016-03 2015-Q3 FY2017 FY2015-01 2015-Q4

TO GET Subsequent Quarter of Previous Year

=(SubField( MaxString(TYQUARTER),'-',1)-1) & '-' & SubField( MaxString(TYQUARTER),'-',2)

Max Quarter

=MaxString(TYQUARTER)

=(SubField( MaxString(TYQUARTER),'-',1)-1) & '-' & SubField( MaxString(TYQUARTER),'-',2)

I am stuck to get the previous quarter based on my Max Quarter.

If Q2 2017 is Present - Q1 2017 Previous

IF Q3 2017- Present - Q2 2017 Previous

IF Q1 2017 Present - Q4 2016 Previous