Comparing a specific week to the corresponding week of the previous year



Hi all,
I’m trying to figure out why the YoY won’t populate when I choose period to be 'Week‘. I’d expect QS to check the YoY for the corresponding week of the previous year? All the other periods work, i.e. Day, Month, and Year, as I expect, but I couldn’t identify the issue with Week. Only WoW will populate when ‘Week’ is chosen. The working week starts on Sunday, so in this scenario, July 6 - July 12, 2025 is the week. Anyone know what the issue is and if there is a workaround?

Impressions_DoD_Percent- periodOverPeriodPercentDifference(sum(impressions), Datefield, DAY, 1)
Impressions_WoW_Percent- periodOverPeriodPercentDifference(sum(impressions), Datefield, WEEK, 1)
Impressions_MoM_Percent- periodOverPeriodPercentDifference(sum(impressions), Datefield, MONTH, 1)
Impressions_YoY_Percent- periodOverPeriodPercentDifference(sum(impressions), Datefield, YEAR, 1)

Datefield -

ifelse(
${Periodstarting}=‘Day’, truncDate(“DD”, {hit_day_loc}),
${Periodstarting}=‘Month’, truncDate(“MM”, {hit_day_loc}),
${Periodstarting}=‘Week’, truncDate(“WK”, {hit_day_loc}),
truncDate(“YYYY”, {hit_day_loc})
)

Hello @Phillip_Le

I think the problem here is that the weeks don’t line up exactly year over year. So using week number would be a better way to do this.

I’m currently trying to create a potential work around for this that uses weeknum() which isn’t a listed funciton in Quick Sight but does work.

In the mean time, you could create an arena link that would help troubleshoot this.

Yes, let me do that. I’ll create an arena link. That’s what I thought could’ve been the issue.

1 Like

Hey @Phillip_Le

Were you able to create the arena link?

Hello @Phillip_Le

It’s been a while since we have heard from you, do you still need help with this question? If we don’t hear from you in the next two business days this topic will be archived.

Again, I think your best bet is to use weeknum() to calculated the week and then comparing them YoY.

Hello @Phillip_Le

This topic is being archived because we have not heard back. if you still need help please feel free to post a new topic at the top of the community with your question. You can link to this old topic in your new post.