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

calculating variations by week

hello,

I have to calculate the result difference from a week day to another, but I didn't found any solution.

Here is the objective (see "variation" column):

DateProductSales ($)Variation ($)
29/5/2017Apples25k-
29/5/2017Bananas10k-
29/5/2017Lemons6k-
5/6/2017Apples21k+4k
5/6/2017Bananas23k+13k
5/6/2017Oranges19k-
12/6/2017Apples39k+18k
12/6/2017Bananas22k-1k
12/6/2017Oranges12k-7k

Do you have any idea?

Many thanks in advance,

Nicolas

1 Solution

Accepted Solutions
sunny_talwar

Date and Product will be your dimensions here? Try this

Aggr(Sum(Sales) - Above(Sum(Sales), Product, (Date, (Numeric)))

View solution in original post

5 Replies
sunny_talwar

Is this something you need in the script or front end?

Not applicable
Author

preferably in the front end because the script has an automated load through several excel files.

sunny_talwar

Date and Product will be your dimensions here? Try this

Aggr(Sum(Sales) - Above(Sum(Sales), Product, (Date, (Numeric)))

Not applicable
Author

It works Sunny

Thank you so much!

Not applicable
Author

By the way, it has worked without the "numeric" field:

Aggr(Sum(Sales) - Above(Sum(Sales), Product, (Date))