Fixed LOD when value matches another column

45 Views Asked by At

Hello I have a data set with a 'date' column and a 'previous date' column that shows 'demand' for the current period. I am trying to compare the demand across the current and previous date but am a little stuck on how to show demand for the previous period in tableau.

start date previous start date Demand
jan 1 aug 12 5
Oct 11 jan 1 7

the goal is to have tableau show Oct 11 demand as 7, and then based on the prev date matching another value in the start date column, it will show previous demand as 5

1

There are 1 best solutions below

3
On

Lets say I have data in the format mentioned. Rather than a calculated field, the other solution would be to join the same data over itself with previous date as primary key and start date as foreign key and this would give you your required results rather than calculating it.

The below image shows the solution.

enter image description here