1 of 1 people found this helpful
If you bring in your data in a column like approach as per the example, you're going to have to specify each individual column name in any formula you build.
Instead, you would be better off with a structure like;
ClientID, VariableName, Value
100010, Variable1, 1
100010, Variable2, 0
This would help you keep things more dynamic. You can reshape your data externally or take a look into the pivot function when connecting to your data.
You could use a parameter to create a couple calculations that would allow you to show the percentage for each variable. However, I agree with Tom that a pivoted data structure would make it easier. I've attached a workbook that shows both methods so you can take a look at a couple of ways to do this. Here are the methods:
1. Create a parameter that has each variable listed
2. Create a logical calculation that will flip between each measure based on the parameter
3. Create the percentage calculation, using the logical calculation above
4. Show parameter and use
1. Pivot the data in Tableau or beforehand
2. Create the percentage calculation
3. Show filter and use
Let me know what you think.
Dynamic Variables.twbx 15.1 KB
Thank you, Tom, this worked brilliantly! I had not seen this function before, and now that I know about it, it's going to save me a lot of up-front time.
No problem Steve, I'm glad I could help out.
Please be sure to mark the answer as Correct going forward to close out the thread.