Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SubstituteHoliday to match WorkingDays range [2..6] #49

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

albertospelta
Copy link
Collaborator

Fixes an issue where the calculated substitute holiday day is incorrect when FridayIfSaturdayOrMondayIfSunday (-1) is used.
Repro: year 2022 or 2023, config { "US", 12, 25, 0, 0, 0, "Christmas Day", -1, 100, 0, 0 }

This patch aims for preserving backward compatibility instead of breaking the current configuration value { 2, 3, 4, 5, 6 }, which is used in multiple date templates.

A change to the documentation is also required here: https://docs.sqlbi.com/dax-template/configuration/config-object/holidays#workingdays to update the statement "The weekdays are expressed by integer numbers where Sunday is 0" where Sunday should be 1 instead of 0.

Fixes an issue where the calculated substitute holiday day is incorrect when `SubstituteHoliday.FridayIfSaturdayOrMondayIfSunday (-1)` is used.
Repro: year `2022` or `2023`, config `{ "US", 12, 25, 0, 0, 0, "Christmas Day", -1, 100, 0, 0 }`

This patch aims for preserving backward compatibility instead of breaking the current configuration value `{ 2, 3, 4, 5, 6 }`, which is used in multiple date templates.

A change to the documentation is also required here: https://docs.sqlbi.com/dax-template/configuration/config-object/holidays#workingdays to update the statement "The weekdays are expressed by integer numbers where Sunday is 0" where Sunday should be 1 instead of 0.
@albertospelta albertospelta marked this pull request as ready for review April 11, 2024 11:48
@albertospelta albertospelta merged commit 2064896 into main Apr 11, 2024
1 check passed
@albertospelta albertospelta deleted the alberto/fix-WorkingDays-range branch April 11, 2024 11:49
@albertospelta
Copy link
Collaborator Author

Fixes sql-bi/Bravo#555 and sql-bi/Bravo#576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant