I am a new user, loving Tableau, but now I'm a bit stuck. I am analyzing clinical trial data. The data looks like this
Table 1 - visit
Table 2 - labs
Tables are linked by "subject"
What I want to do is to calculate the study day (not date) when the lab was taken. In the "visit" table, the date for Day 0 would be defined when visit_name="Day0".
So I am trying to calculate in order
1) The day 0 for each patient (day_date)
2) The lab day for each patient by subtracting day0_date from lab_date
I calculate day 0 by creating a calculated field:
if [visit_name]='Day0' THEN visit_date END
But that only calculates that row for the row where the visit is Day0, and I can't use this for the other calculations...
How can I do this ? Thanks in advance
Retrieving data ...