I’m working on Something that I can’t quite figure out.
Basically, I have a data set that looks like this:
– Date: Just Dates for the last two years
– EOM Date: The last day of the month for the above Date
– Apps: The number of applications received.
I’m trying to create a table that looks like this:
EOM DATE,
A column that is for the Current Month, “Month To Date Apps” and Previous months just the total Apps,
A column that is just like Column 2 but For Last Year
The % Change for Columns 2 and 3 YoY
Column 2 I think is basically just: periodToDateSumOverTime(sum(Apps),Date,MONTH)
That seems to give me the expected result.
I’m not sure how to create a version of that that is offset by one Year… and then also not sure how to do the Period over Period Difference that takes that into account also.
QuickSight has pretty good understanding of dates and date-aware functions. Nice work sorting out the sum over time! Note Q in Quicksight generated my calculated fields by asking for "previous year’s value of " with your formula and it suggested:
And for the YAGO value, it’s actually giving me the FULL month.
i.e. so for July 2025, MTD Apps gives me ~5K, MTD Apps YAGO gives me ~120K because it’s capturing ALL of the apps from July 2024, and we are only 1 day in (data is delayed a day).
@TRube Reading to the end of the blog, it seems there are some limitations here. See " Advanced use case 3: Partial period comparisons" stating " This requires a calculated field using periodOverPeriodDifference nested with the sumIf() window function." The example shows a quarter but you can adapt to a month easily.
Do you have a little public/synthetic dataset you could share here or in the arena, along with expected results?
I think I figured out a solution… even though I will say I don’t love it because I think it mightfail if I ever go back to earlier than just the start of the prior year… but I will worry about that if it happens
Essentially I created two self explanatory relative date parameters:
StartOfThisYearDate
YesterdayDate
Then I created an intermediary calculated Field that I only use in calculation.
I called it LastYearSumIfApps:
sumIf(
Apps,
Date <= addDateTime(-1,‘YYYY’,${YesterdayDate})
)
Basically it will sum all apps, but ONLY if they are from a date earlier than at least 1 year before yesterday, so if you look at the 2024 data daily, this field would sum up all the apps for each day, but be null for 7/2/2024 and after (it is 7/2/2025 today).
Then to create YTD Apps YAGO I did:
periodOverPeriodLastValue(
periodToDateSumOverTime({Last Year SumIF (Apps)},Date,YEAR),
Date,
‘YEAR’,
1
)
I could combine them, but I did it in parts because I kept getting formatting errors from all the nested parentheses and was having trouble figuring out because the error messages are kind of bad in QS once you start nesting functions.
Thanks for the help though! Your post definitely helped me get on the right track.