5 Replies Latest reply on Jul 10, 2018 7:51 PM by Peter Fakan

# Graphing data

Hi Tableau Community,

I was wondering how someone would make data go back in time. What I mean by that is if you have data for June 12 2018 and you have data for June 13 2018, how would you change that data on a graph. I was also wondering if there was a way to do this on a slightly bigger scale like using a formula. If you could reply that would be great and it would help me a lot.

Thanks

• ###### 1. Re: Graphing data

Can you explain the requirement with some sample? It is confusing

• ###### 2. Re: Graphing data

For example,

If I have an x&y data chart, and on the y axis is how many cups of lemonade I have sold in June 2018 ( 1 dot equals 1 day) and on the x axis I have how many cups of smoothie I have sold in June 2018, how would I write a formula to get the data from 2017 smoothie's sales and 2018 lemonade's sales on the same graph . One example of this is, the data from June 29 2018 gets turned into the data from June 30 2017 (so you subtract 364 days).  I'm trying to understand if the 2017 smoothie sales are correlated to the 2018 smoothie sales. Please let me know if you have an answer. Thanks!

• ###### 3. Re: Graphing data

Hi Ryan,

LOOKUP(SUM([sales])-1)

This will work if your aggregation is at the year level, if it is at the month level then you will need to do;

LOOKUP(SUM([sales])-12)

HTH

Peter

• ###### 4. Re: Graphing data

Hi Peter,

I tried your code and it didn't work. Do you have any other ways you think I could get the data that I need.

• ###### 5. Re: Graphing data

Hi Ryan,