Un-Pivot Data in Tableau
Say you have data with fields named: A, B, C, KEY, VALUE. And lets say the KEY field contains a discrete set of possible values like X, Y, and Z. How do you transform your data with Tableau so that your resulting data has fields: A, B, C, X, Y, Z?
Given an original record set of records that have A=a, B=b, C=c:
- the value for X should be the VALUE from the original record containing A=a, B=b, C=c and KEY=X
- the value for Y should be the VALUE from the original record containing A=a, B=b, C=c and KEY=Y
- the value for Z should be the VALUE from the original record containing A=a, B=b, C=c and KEY=Z
If here were 10 records with value A=a, B=b, C=c and various (Key, Value), the resulting transformed data set should have one record having A=a, B=b, C=c. I don't want to have to know ahead of time what values are represented in the KEY field, and I want all unique combinations of values of A, B, C to be consolidated into single records in this way. I essentially want to unfold the data so that the values of the KEY field become columns, and the associated values of the VALUE field become the values under those KEY columns.
This feels like something Tableau should be able to do for me in some standard way, can someone point me in the right direction on how to do it?
Aside
You might ask why do you want to do that? and the reason is because I want to filter out all the rows from my dataset that have the same values of (A, B, C), if any row having that value (A, B, C) has KEY=k and VALUE=v. In order to do that, my idea was that I need all the rows with common values for (A, B, C) to be collapsed into a single row by un-pivoting the (KEY, VALUE) columns in the data set.
Topic transformation tableau
Category Data Science