3 Replies Latest reply on Jul 13, 2016 7:40 AM by Tom W

# How to get the last available number

I'm working on a graph with three fields; the two price forecast (orange lines) and actual prices (red line)

The idea behind the graph is to show the price (red line) two weeks ago. The prices are published once a day for all weekdays, except saturday and sunday.

I tried creating a field to show the last available price, but I clearly didn't do it properly because when there aren't any weekends, for example a wednesday, I get to see more than just the last possible price. Like this:

Attached you'll find the workbook.

I would really appreciate any help regarding the correct string for the calculation.

• ###### 1. Re: How to get the last available number

Are you trying to show a moving price from two weeks ago or one static point with the last available price? I feel like those are two different things.

• ###### 2. Re: How to get the last available number

Hello Tom,

In reality what i'm trying to do is show a moving price from two weeks ago and from yesterday, excluding weekends. I just asked for the price two weeks ago because I thought that if I was able to solve the two week price I would be able to solve also yesterday's price.

Do you have any ideas??

• ###### 3. Re: How to get the last available number

You could use tableau calculations, specifically Lookup - Table Calculation Functions

I've attached an example to get sales from 2 weeks ago (a difference of 10 days as it excludes weekends)