keepitreall89
keepitreall89

Reputation: 1230

Tableau - Return string value from date

I have a simple data set listed below

ID
Date
Status (String)

I have 2 parameters setup [Start Date] and [End Date] What the end goal is to do is display a list of any [ID] where the [Status] has changed between the [Start Date] and [End Date]. I really don't care about the in-between dates, just where [ID][Start Date][Status] != [ID][End Date][Status]. I'm having a lot of trouble figuring out any thing I can use to do this in tableau, any suggestions would be appreciated.

EDIT: Really if any one can help me get a calculated field that equals the Starting status, I can probably figure the rest out. Thanks

Upvotes: 1

Views: 252

Answers (1)

Alex Blakemore
Alex Blakemore

Reputation: 11896

You can start by experimenting with a few simple calculated fields, although things might get a bit trickier later.

Try defining a field called [Start Date Status] defined as if [Date] = [Start Date] then [Status] end Define [End Date Status] similarly. (the brackets are not part of the name)

Then define a field called [Status Changed] as min([Start Date Status]) <> min([End Date Status])

You can then use these in different ways — for example put Id on Rows and Status Changed on Text.

You can explore extensions to, say, handle Ids that don’t have a record for the start or end date

Upvotes: 1

Related Questions