Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Aggregate excluded values

Hello,

I am trying to sum sales for the time period that is not selected. I would like to sum the sales by week and display in a table with SKU number and the sum of sales. However, I am not getting a null output.

Any help would be greatly appreciated.

sum(

aggr(

sum({$<Week=E([Year Week]), SKU=P(SKU) >}Sales)

,  SKU, Week)),

)

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Sum({$<Week=E([Year Week]), SKU=P(SKU) >} Aggr(Sum({$<Week=E([Year Week]), SKU=P(SKU) >}Sales), SKU, Week))

View solution in original post

3 Replies
sunny_talwar

Try this:

=Sum({$<Week=E([Year Week]), SKU=P(SKU) >} Aggr(Sum({$<Week=E([Year Week]), SKU=P(SKU) >}Sales), SKU, Week))

Anonymous
Not applicable
Author

That works! Thanks!

And if I wanted to take the standard deviation of the sales for each of the weeks, how would I go about writing the syntax?

Thanks!

sunny_talwar

May be this:

=Stdev({$<Week=E([Year Week]), SKU=P(SKU) >} Aggr(Sum({$<Week=E([Year Week]), SKU=P(SKU) >}Sales), SKU, Week))