Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stijnval
Contributor III
Contributor III

Week over week comparison in a line graph

Hi experts,

I am trying to display the following:

A line chart with weeknumbers as the dimension. In the graph I want to display sum of sales, but the values should be the comparison of the week to the week before. For example, the sum of sales value for week 7 should be the sum of sales for week 7 compared to the sum of sales for week 6. Week 8 would display the comparison between week 8 and week 7 etcetera. I have Dates/Weeknumbers but I can't get the measure to work. It either displays the the same value as the actual week or just plain 0.

I've been trying set analysis and using AGGR but no succes so far. Any ideas?

Thanks!

Stijn

1 Solution

Accepted Solutions
OmarBenSalem

try :

(Sum(sales)-above(sum(sales)))/above(sum(sales))



Result:

Capture.PNG

View solution in original post

3 Replies
OmarBenSalem

try :

(Sum(sales)-above(sum(sales)))/above(sum(sales))



Result:

Capture.PNG

stijnval
Contributor III
Contributor III
Author

It works! Thanks!

OmarBenSalem

With the current expression, if u select a week you won't get a good result; if u want the result to be good if u select a week, please do as follow:

sum({<week=p(week)>}aggr((Sum({<week>}sales)-above(sum({<week>}sales)))/above(sum({<week>}sales)),week))


Result:

Capture.PNG