Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to create a straight table that displays a linear regression calculated by hand where the x-axis is Weeks Ago and the y-axis being Qt Sold. Below is a screenshot of how far I have gotten to this point:
I need to TOTAL or SUM the last column (x-xBar)(y-yBar) which contains the following expression:
([ord_dt.autoCalendar.WeeksAgo]-(Avg(TOTAL([ord_dt.autoCalendar.WeeksAgo]))))
*
((Sum(qt_ordd))-(Avg(TOTAL(qt_ordd))))
The catch is, I need to get that total or sum for all records... A simple example is below.
Weeks Ago | (x-xBAR)(y-yBAR) | SUM((x-xBAR)(y-yBAR)) |
---|---|---|
0 | -5 | 15 |
1 | -2 | 15 |
2 | 1 | 15 |
3 | 6 | 15 |
4 | 7 | 15 |
5 | 8 | 15 |
If anyone can help with this it would be great!
May be this
Sum(TOTAL Aggr(
([ord_dt.autoCalendar.WeeksAgo]-(Avg(TOTAL([ord_dt.autoCalendar.WeeksAgo]))))
*
((Sum(qt_ordd))-(Avg(TOTAL(qt_ordd))))
, [Weeks Ago]))
May be this
Sum(TOTAL Aggr(
([ord_dt.autoCalendar.WeeksAgo]-(Avg(TOTAL([ord_dt.autoCalendar.WeeksAgo]))))
*
((Sum(qt_ordd))-(Avg(TOTAL(qt_ordd))))
, [Weeks Ago]))
Thank you Sunny! It worked!