Unfortunately due to business reasons I am still on Tableau 9.3 so I can't open your twbx but from what you have written it sounds like you want a type of pivot function. Are you using sql as your data source or something else? A sql pivot (Using PIVOT and UNPIVOT) would transform your data like in the example below which sounds like what you are looking for. If you are using a sql data source then you can do this transformation in the custom sql option in Tableau.
Record ID Field Value ID Field Value 1 1 a 1 2 b 1 3 c 2 1 x 2 2 y 2 3 z
Record ID Field Value ID 1 Field Value ID 2 Field Value ID 3 1 a b c 2 x y z
Another option is to join a new table to your current data that contains the Field Value ID and Field Value Title.
In the attached example, I created the following table in Excel and joined it to your data:
Field Value ID Field Value Title 1 Fruit 2 Hot Beverage 3 Country
Hope this helps,
Thank you very much for your help. Unfortunately I am still stuck.
The data source is a JSON file so I can unfortunately not use the SQL pivot.
I was able to reproduce the second suggested solution but it is not entirely what I was looking for as it does not offer any filtering option.
When a filter is applied to one of the values of the Field Value Titles, the others simply disappear from the view.
What I am trying to do is really to split these fields as if they were individual columns.
But it sounds pretty tricky, maybe it's simply not possible.
Many thanks for your help.
See this Re: Can Tableau process JSON data?
Maybe you can try to convert JSON data to csv somewhere else first? Google for it. There are many options available. ie. SSIS Exporting Data from JSON to CSV with SSIS - SQLServerCentral ,
I was able to do what you are looking for using the ATTR function. Please see the attached workbook. First I changed your calculations for each field by removing the else "" clause, this makes it so that if there is no value instead of a blank you get a null. You can then create secondary calculations (I named them Distinct Fruit etc.) that use the ATTR function, this will return the non-null field value and since that is only one value per ticket id we get the result you are looking for.
Hope this helps!
CustomFields Split ATTR.twbx 43.4 KB
Thanks a lot, Jian.
I will definitely look into this option for the future.
Thank you very much, Christina.
It's exactly what I was looking for.
It opens a new set of questions now in regards to filtering on the ATTR fields in connection to other views :-) But my initial question is solved.
Thanks a lot for having taken the time to look into it.
Wishing you all a Merry Christmas!