# Forecast Aggregation

**URL:** <https://community.amazonquick.com/t/forecast-aggregation/28595>\
**Category:** Q&A\
**Tags:** calculations, Business-Intelligence-Engineer, quick-sight\
**Created:** [April 12, 2024, 6:38pm UTC](https://community.amazonquick.com/t/forecast-aggregation/28595 "2024-04-12T18:38:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkelley](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@mkelley](https://community.amazonquick.com/u/mkelley)\
**Post date:** [April 12, 2024, 6:38pm UTC](https://community.amazonquick.com/t/forecast-aggregation/28595/1 "2024-04-12T18:38:24Z")

</div>

Hello,  
I am using the ML forecasting feature for some of my line level transaction data. Within the visuals that I have included the forecast it is usually accurate for daily data but when I aggregate to Weekly and Monthly forecasts they assume those week’s or months are complete when partial data is loaded. Data is added each day so the weekly forecasts are only accurate after saturday data has loaded. Is there a way to have it recognize not all data has been loaded for certain periods?

Also, is there a way to compare actual results to the projections as more data is added each day? Below are screenshots of the forecast graphics.

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/3/c/3c3493e8921a6eba3785128dd74544ff58073e7e.png)  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/4/7/470f2713e4dd32df25e3353d4628b0fb7ed51ded.png)  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/4/9/49f469e6c3a2f8bd594b2a3f1ef7998e168bdece.png)

---

<div class="post-metadata">

**Author:** ![WLS-D](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-d/32/36109_2.png) [@WLS-D](https://community.amazonquick.com/u/WLS-D)\
**Post date:** [April 15, 2024, 2:40pm UTC](https://community.amazonquick.com/t/forecast-aggregation/28595/2 "2024-04-15T14:40:22Z")

</div>

Hello @mkelley !

My team has done something similar in the past using a calculation similar to the one below to show only data for completed weeks:

```auto
ifelse(
${ENDTIME} <= now() AND extract('WD', ${ENDTIME}) >= 6 AND extract('WD', ${ENDTIME}) <= 7 AND DATE <= ${ENDTIME} AND DATE >= TrendStartDate, 
DATE,
${ENDTIME} >= now() AND extract('WD', now()) >= 6 AND extract('WD', now()) <= 7 AND DATE <= now() AND DATE >= {your_date_field}, 
DATE,
${ENDTIME} >= now() AND extract('WD', now()) < 6 AND DATE <= addDateTime(-(extract('WD', now())), 'DD', now()) AND DATE >= {your_date_field}, 
DATE,
${ENDTIME} <= now() AND extract('WD', ${ENDTIME}) < 6 AND DATE <= addDateTime(-(extract('WD',${ENDTIME})), 'DD', ${ENDTIME}) AND DATE >= {your_date_field}, 
DATE,
NULL
)

```

Small note with this, Quick Sight will show this on a line graph as the first day of that week so for example the data for last week would be called “April 7”.

For your last question, I’m not sure that there is a way to pull the data from the forecast, and I don’t think its possible to use the colour by when using forecasting in a line graph.

---

<div class="post-metadata">

**Author:** ![WLS-DM](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-dm/32/36109_2.png) [@WLS-DM](https://community.amazonquick.com/u/WLS-DM)\
**Post date:** [April 22, 2024, 3:50pm UTC](https://community.amazonquick.com/t/forecast-aggregation/28595/3 "2024-04-22T15:50:11Z")

</div>

Hello @mkelley, since we have not heard back from you, I will mark the last response from @WLS-D as the solution. If you have any further questions on this issue, please let us know. Thank you!
