Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last Month of last year

Hi,

How to get Last month of prior year . For example - Fiscal calendar followed is  July -June cycle .

As per current  month we are in  Nov 2017 so i need to get  last month of prior year that is June 2016 .

Any help  please .

Thanks,

Prithvi

1 Solution

Accepted Solutions
tresesco
MVP
MVP

=MonthName(Yearend(today(), -1, 7))

View solution in original post

6 Replies
tresesco
MVP
MVP

=MonthName(Yearend(today(), -1, 7))

Not applicable
Author

Hi,

Thanks for response . This code works for current month only .

I need to find last month of prior year irrespective of month selected  from current year .

example: if we are Sep  2017 then code you provided returns Dec 2016  not June 2016 .

Thanks,

Prithvi

Not applicable
Author

Hi ,

i see different output  in the query below, it returns Dec 2016 .

If(MonthName('03/01/2017') = MonthName(TempDate), '1',

    If(MonthName(AddYears('03/01/2017',-1)) = MonthName(TempDate),'1',

    If(MonthName(Yearend('03/01/2017', -1, 7))=MonthName(TempDate),'1'))) as 'YTDFlag'

Any issue with code above.

Thanks,

Prithvi

vinieme12
Champion III
Champion III

if your Fiscal month end is always june why do you even consider current month?

TRY

=MAKEDATE(if(Month(TODAY())>6,year(today()),year(today())-1),6)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
tresesco
MVP
MVP

It should work fine even if you select any month from current year. Please try to share your qvw with sample data that demonstrates the issue.

Not applicable
Author

Hi,

Thanks  you .

It worked  , with small change .

If(MonthName(Yearend('03/01/2017',-1))=MonthName(TempDate),'1') as 'YearMonth',

Thanks,

Prithvi