4 Replies Latest reply on Oct 12, 2016 3:06 AM by hanneke.vankeep

# Sorting weeks in YoY chart

Hi!

I am making a line chart showing YoY growth per week.

To calculate the YoY growth I used the following calculated field:

(ZN(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1)) / ABS(LOOKUP(ZN(SUM([Sales])), -1))

However, I run into a problem when I make the linegraph.

My data starts at week 44 2014, which it compared to week 44 2015. This goes all the way to week 30 2015/2016.

When I make the linegraph, it starts with week 1 (comparing 2015/2016) all the way to week 30 (2015/2016) then there is a jump and it continues to week 44 (2014/2015) until week 53.

I would like to have the graph start at 44 and end at 30, but if I include the year, my calculated field does not work anymore.

Is there a way to manually "sort", the weeknumbers on the x-axis? Or another way to solve this?

Thanks!

• ###### 1. Re: Sorting weeks in YoY chart

Hi Vankeep,

There is another way for YOY.

Best

Shriram Saxena

2 of 2 people found this helpful
• ###### 2. Re: Sorting weeks in YoY chart

With that method, I can now indeed change the dateformat to weekyear instead of just week, so that is great!

However the chart then shows all values, also week 44 2014.

Can I change the chart to showing only week 44 2015 until week 30 2016, while the other values are still taken into account for the calculation (so filtering doesn't work)?

• ###### 3. Re: Sorting weeks in YoY chart

I also see that I made a mistake in my formula and the same is happening in the suggestion above.

It is not calculating the YoY difference but rather the difference from week 1 to week 2 etc.

Any suggestions on how to fix this?