Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I need a set analysis that will pick up the last quarter?

Hi Guys

I need a set analysis that will pick up the last quarter?

I tried this one, but I think it doesn't work because when you do -1 on Quartername function it gives you the date in "47637" etc.

=sum({<[Quarter Name]={$(=QuarterName(today()))-1}>}[Sick Days Lost])

I've got

Year

Month

MonthYear

QuarterYear

MonthName

MonthNum

In a calendar.

Thanks

1 Solution

Accepted Solutions
NickHoff
Specialist
Specialist

create an indicator in your calendar for the previous quarter

Year(DateField) & '-' & 'Q' & Ceil(Month(DateField)/3) AS CalendarYearAndQuarter

IF(quarterstart(DateField) = quarterstart(today(),-1),1,0) as PreviousQuarterIND,

Then for your set use:  =sum({<[PreviousQuarterIND]={1}>}[Sick Days Lost])

View solution in original post

5 Replies
neelamsaroha157
Specialist II
Specialist II

If you have Quarter in the Q'n' format then you can use

'Q' & Ceil( Month(QuarterStart(max(Date), -1)) /3 )

or you can convert this expression to whichever format you want.

Anonymous
Not applicable
Author

In a set analysis to sum something?

Anonymous
Not applicable
Author

I Think that worked, let me check the numbers.

NickHoff
Specialist
Specialist

create an indicator in your calendar for the previous quarter

Year(DateField) & '-' & 'Q' & Ceil(Month(DateField)/3) AS CalendarYearAndQuarter

IF(quarterstart(DateField) = quarterstart(today(),-1),1,0) as PreviousQuarterIND,

Then for your set use:  =sum({<[PreviousQuarterIND]={1}>}[Sick Days Lost])

Anonymous
Not applicable
Author

That worked a treat, numbers match spot on!