Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I made it to complicated. So let me try this:
If(MONTH(Today(1)) = 'Jan',
IF(Year(OrderingPrescriber_RevenueDate) = (Year(Yearstart( Today( ) ))-2)
,Year(Today(1))-2
,Year(Today(1))-1)
,
IF(Year(OrderingPrescriber_RevenueDate) = (Year(Yearstart( Today( ) ))-1)
,'STLY'
,'YTD'))
So if the current month is Jan I want to have it display 2013 and 2014 but if the current month is not Jan, we will consider it the current years data and we want it to display STLY and YTD.
Shouldn't the second IF test be something like this (pseudo code) ?:
:
IF ((Year(OrderDate) = Year(Today()) -1) and (Month(OrderDate) = 12), 1, 0) , ...
I am a little bit confused on exactly what you are doing, but you can also use the InYearToDate() function as well to determine if a date is In the year to date. If you pass the function a -1, it will tell you if the date was in Last year's year to date (using the current date). I am not sure if that will help you but wanted to throw it out there.
This post might help with calculating YTD
I made it a bit complicated to understand. I redid the original post. Could you please take a look?