I am new to Tableau. I am working through the online tutorials, books, and courses. I have simple problem that I am trying to solve in Tableau. I would like to Index records along a row. At first, I thought this would be a trivial task but after trying a variety of Table Calculation and LOD calculations. I am stumped. I have attached a workbook to illustrate my problem. I have two dimensions (patientvisit_id, entry). I have one measure (duration).
PatientVisit_ID Entry Duration
A 1 10
A 2 20
A 3 30
A 4 40
B 1 10
B 2 20
B 3 30
C 1 10
C 2 20
I would like to know how to create a cross tab that has an index of the patients displayed. If I put Entry on the Columns shelf, PatientVisit_ID on the Row shelf, and Duration on the Marks shelf as Label. I create a Calculated Field called Index with the Index() as the Calculation. Table calculation is Table Down. I put this on the Row shelf after the PatientVisit ID. When I make PatientVisit_ID and Entry Discrete my table looks like this
with multiple columns showing the duration at various Entries. This is exactly what I want except that Entry must be continuous. When you change the Entry to continuous the table now the rows look like this
I have created a workbook to illustrate this behavior. All you have to do is change the Entry in the Columns shelf from Discrete to Continuous to see the problem as I have described it above.
I am hoping that someone will be able to explain why the rows are displayed like this when Entry is set to Continuous. I am also hoping that someone will be able to show me how to index my PatientVisit_Id properly.
This is just a toy example I worked up to illustrate the problem. The real problem I am try to solve is display my PatientVisit_Ids one per row in a Gantt chart. There are multiple bars for each patientvisit_id in my Gantt chart. As a result, there are multiple entries (Entry, which is a datetime field) for each patientvisit_id. The actual patientvisit_ids are irrelevant to the people viewing the Viz, however, seeing an index of the number of rows in my Gantt chart would be useful.
Any help, suggestions, or a solution to my problem is greatly appreciated.
Thank you in advance.
index_problem.twbx 18.0 KB