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

Year to date Set Analysis

I have the following set analysis for calculating Year to Date based on calendar year:

Screen Shot 2016-05-03 at 09.44.25.png

where MonthID is calculated as follows:

Screen Shot 2016-05-03 at 09.49.11.png

i have a fiscal month variable which is vFM = 6 denoting when the month the fiscal year starts. How can this be adjusted to come to a Year to Date based on the fiscal year calendar?

Regards.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Sunny

Ended up using flags as follows:

Screen Shot 2016-05-04 at 08.45.46.png

then using set analysis with

Screen Shot 2016-05-04 at 08.46.13.png

giving the correct result as :

Screen Shot 2016-05-04 at 08.46.37.png

How do i do the following flags:

  1. Previous month
  2. Previous two months
  3. Quarter to date
  4. Last year quarter to date
  5. Same quarter of last year

Regards

View solution in original post

12 Replies
sunny_talwar

May be something like this in the script

AutoNumber(Mod(Month(Date) - $(vFM), 12)+1) as FiscalMonthID


Num(Mod(Month(Date) - $(vFM), 12)+1) as FiscalMonthID

NOTE: Grabbed the logic from here

Fiscal and Standard Calendar generation

Anonymous
Not applicable
Author

Many thanks Sunny

The recommendation above gives the same value as the calendar Year to Date

Regards

sunny_talwar

How about something like this:

Sum({<Year, Quarter, Month, MonthID, Date = {"$(='>=' & Date(YearStart(Max(Date), 0, 6), 'YourDateFieldFormatHere') & '<=' & Date(Max(Date), 'YourDateFieldFormatHere'))"}>} Amount)

Anonymous
Not applicable
Author

Sunny the moment i enter the expression, i get a message 'Error in expression'

sunny_talwar

Can you share a screenshot? In the mean time I can check the syntax.

sunny_talwar

Sum({<Year, Quarter, Month, MonthID, Date = {"$(='>=' & Date(YearStart(Max(Date), 0, 6), 'YourDateFieldFormatHere') & '<=' & Date(Max(Date), 'YourDateFieldFormatHere'))"}>} Amount)

Did you replace YourDateFieldFormatHere with your datefield's format or did you just copy and paste the whole thing?

Anonymous
Not applicable
Author

I replaced it with 'MM/DD/YYYY'

sunny_talwar

Can you share a screenshot of the error? Did you try clicking okay to see if you still see any result or not?

Anonymous
Not applicable
Author

Many thanks, i had not click ok, when i do so i get the following result:

Screen Shot 2016-05-03 at 22.17.48.png

However the calculated Year to Date is 8 132 064.83