Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there anyway to make an expression that is based on the selection of the year?
At the moment, I have expressions that include variables for current year-to-date and prior year-to-date so they show data for 2018 and 2017. But i have data going back other years that would be good to see year-on-year for so depending on the selected year, I would want to see the year-to-date for that year and then the year-to-date for the year before.
Is that possible?
Year to date when year is selected will be the whole year, right?
I think you have used Today() in your YTD and LYTD expressions.
Just replace Today() with user selected dates... i.e. Max(YourDateField)
Something like below..
Date Level Analysis - WTD, MTD, QTD & YTD (Current Year & Previous Year)
Use set expressions with syntax along these lines
{<Year = {'$(=Max(Year))'}, ... >}
{<Year = {'$(=Max(Year)-1)'}, ... >}
You may need to override the actual selection, if you are making date selections in fields other than year. Max() will produce the latest (current) year when nothing is selected, or the selected year if when a selection is made.
In your case set the YTD for all the years base on the date and use the addyear() function mark the required year to date
But I was thinking that I would need an expression to have a year-to-date based on the month picked so if March
But I think I need an expression that shows YTD regardless of the year clicked so at the moment its 2018 and 2017 but if 2015 was selected then it needs to show that instead? Does that make sense?
So, in that case a front end set analysis based expression is the way to go... Manish shared links where you can look at the set analysis that can be used