# How to create a weekly YTD

**URL:** <https://community.amazonquick.com/t/how-to-create-a-weekly-ytd/26398>\
**Category:** Q&A\
**Tags:** calculations, Business-Intelligence-Engineer, quick-sight\
**Created:** [February 25, 2024, 2:06pm UTC](https://community.amazonquick.com/t/how-to-create-a-weekly-ytd/26398 "2024-02-25T14:06:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ErikG](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/erikg/32/14524_2.png) [@ErikG](https://community.amazonquick.com/u/ErikG)\
**Post date:** [February 26, 2024, 6:26am UTC](https://community.amazonquick.com/t/how-to-create-a-weekly-ytd/26398/2 "2024-02-26T06:26:08Z")

</div>

HI @kofmand  
maybe you can have a look at:

> [@Previous Year YTD Aggregation functions](https://community.amazonquick.com/t/previous-year-ytd-aggregation-functions/12839/2):
>
> Hi ChenjingLyu, I hope below solutions will meet your requirements, kindly check these calculations Max Date: maxOver({your date field}, [], PRE\_AGG) Between dateDiff(), addDateTime(), truncDate(), and extract() you can define whatever periods you want (and there are often multiple ways to do each one, these are just some proven examples). Please create Parameter ( Name it as AsOfDate ) by selecting fixed date option, then try below calculations Today: ifelse(dateDiff({order\_date},${As…

or

> [@Partial Period Comparison WTD WOW](https://community.amazonquick.com/t/partial-period-comparison-wtd-wow/17264/4):
>
> Think I may have found a solution WTD Sales = ifelse(dateDiff(truncDate('WK', {date}),${Today},'WK') = 0, {Sales}, NULL) Prior WTD Sales = ifelse(dateDiff(truncDate('WK', {date}),${Today},'WK') = 1 AND extract('WD', {date}) \<= extract('WD', addDateTime(-1, 'DD', now())), {Sales}, NULL) WoW % Diff = (sum({WTD Sales})-sum({Prior WTD Sales}))/sum({Prior WTD Sales})

BR

---

_[View the full topic](https://community.amazonquick.com/t/how-to-create-a-weekly-ytd/26398)._
