Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Nested Aggregation - Sum/Total of another Expression

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-215
2115
3615
4715
5815

If anyone can help with this it would be great!

1 Solution

Accepted Solutions
MVP

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]))

2 Replies
MVP

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]))

Contributor III
Author

Thank you Sunny!  It worked!

Community Browser