Periodoverperioddifference calculation accounting for day of the week variation

Hello, I am encountering issues with the periodOverPeriodDifference function , specifically when adjusting for day-of-week variations. My goal is to analyze year-over-year data by adjusting comparison dates based on day of the week, to enable accurate plotting on a line chart by date versus the previous year. While a straightforward year-over-year comparison works (e.g., 1st Jan 2025 to 1st Jan 2024), I need to compare dates like 2nd Jan 2025 to 4th Jan 2024 due to business requirements.

Here’s the function I’m using:

periodOverPeriodDifference(
sum(passengers),
addDateTime(-3, ‘DD’, {activity_date}),
YEAR,
1
)

This function errors out when implementing the day shift in the addDateTime function. How can I correctly set up this function to meet my specific day-of-week comparison needs?

Thank you for your help!

Hi @Tobi

Your formula looks fine. What error do you get?

Regards,
Giri

Hi @Giridhar.Prabhu I get the below error message.
Expression {{argumentName}} for function {{functionName}} has incorrect argument type {{incorrectArgumentType}}. Function syntax expects {{functionSignature}}.

Hi @Tobi,
Checking in here as it’s been awhile since last communication on this thread, are you still working on this case or were you able to find a work around in the interim?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you

Hi @Tobi,
Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!