
1. Re: Dynamic Formulas?
Tom W Dec 7, 2016 2:21 PM (in response to Steve Atkinson)1 of 1 people found this helpfulIf 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
etc.
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.

2. Re: Dynamic Formulas?
Keshia Rose Dec 7, 2016 4:21 PM (in response to Steve Atkinson)Hi Steve,
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:
Original Structure:
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
Pivoted Structure:
1. Pivot the data in Tableau or beforehand
2. Create the percentage calculation
3. Show filter and use
Let me know what you think.
Take care,
Keshia

Dynamic Variables.twbx 15.1 KB


3. Re: Dynamic Formulas?
Steve Atkinson Dec 9, 2016 2:37 PM (in response to Tom W)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 upfront time.
Much appreciated!
Steve

4. Re: Dynamic Formulas?
Tom W Dec 12, 2016 7:25 AM (in response to Steve Atkinson)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.