Will be good to have more details of your case.
Are you sure you need a variable for that purpose?
If you need to show YTD calculation, have you tried RunningSum function?
I could use a runningsum function but how would you have it added up to a specific month. for example I’d want it to add up January, February,March, April and May if we’re in May.
If you need to show all the months in the report, with their correspondant YTD, you can use RunningSum. Otherwise, if you are showing information for a single month (with its correspondant YTD) you can use a Filter Object defined at universe level that brings you the acumulated data.
Which of these scenarios apply to you?
I have two years of information in my recordset. 2006 goes from January to December. 2007 goes to October. I need to do a YTD comparison for 07 vs. 06. How would you get the report to add up to October? I can’t use filter as I need the full year information for 2006 elsewhere on the report. And adding a where clause to select months from January to October is not practical since there are tons of formulas I am using.