3 Replies Latest reply on Mar 23, 2016 3:29 PM by Shivang Desai

# Shifting a graph value one week back to last year

Hi All,

My current work involves shifting a graph value to 1 week back. I have successfully done 90% of it.

Now only a small issue is shifting the graph value on week 01 2015/16 year to week 53 2014/15.

As you can see below in Screenshot 1, starting value of 2016/17 is on week 02. But in Screenshot 2 I shifted that value to week 01 using a calculated field "Shifted Date"

Shifted Date logic:

IF [Date_Financial Year] = "2016/17" THEN [Date_Financial Week]

ELSE "Week " + RIGHT("00" + str(int(RIGHT([Date_Financial Week],2)) - 1),2) END

This shifts the graph value to one week back.

But now just one issue is there, as you can see in screenshot 2 there is "Week 00" value of 2015/16 (purple line)  which I want to convert to "Week 53" of 2015 (Blue line).

How can I implement using above calculation or any other logic?

Screenshot 1

Screenshot 2

Kind Regards,

Shivang Desai

• ###### 1. Re: Shifting a graph value one week back to last year

Hi Shivang,

Please see the attached workbook. We are using the lookup formula which lets us take the value from another part of the table and use it. In this case we are shifting left and that means we can use the lookup function. Depending how far left or right you are using the function you just need to adjust the last part accordingly.

Cheers!

Carl Slifer

InterWorks

• ###### 2. Re: Shifting a graph value one week back to last year

Hi Carl,

I am not able to view your workbook. Its saying "Errors occured while trying to load the workbook. The load was not able to complete successfully".

I am using licensed Tableau 8.2 , may be you have created the workbook in the latest 9.X version. So may be because of that.

Regards

• ###### 3. Re: Shifting a graph value one week back to last year

Can you add the logic here ?