14 Replies Latest reply on Nov 12, 2017 6:36 PM by Tom W

Change one parameter based on another parameter values selection (Nested Parameter)

Hi All,

Please let me know how to achieve this in tableau.

In the below image i have three parameters named as "Year", "Month" & "Year Month" when customer select a value in year and month now year month parameter has to change according to its value.

For E.g., here Year=2017, Month=Aug so Year Month should be Aug,2017 but now its April,2017.

Thanks & Regards,

Nandha

• 1. Re: Change one parameter based on another parameter values selection (Nested Parameter)

You can't control the value of a parameter using something else.

You could create a calculated field which combined Year and Month.

• 2. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Calculated field for?

• 3. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Combining the year and month.

• 4. Re: Change one parameter based on another parameter values selection (Nested Parameter)

I am using year month parameter to show rolling of 12 months with the below calculation

if datetrunc('month',dateadd('month',11,[D Rqst1])) >= [Year Month Parameter] and datetrunc('month',[D Rqst1])<=[Year Month Parameter] then "show" else "hide" end

• 5. Re: Change one parameter based on another parameter values selection (Nested Parameter)

So create a calculated field which replaces [Year Month Parameter] in that formula above. The calculated field should combine the two parameters together and you could use something like DATEPARSE to turn the string into a date.

• 6. Re: Change one parameter based on another parameter values selection (Nested Parameter)

I created below calculated field but I can see only one bar (selected month) not the 12 months info. Can please you help me here ?

if month([D Rqst1])=[Month Parameter] and Year([D Rqst1])=[Year Parameter]  Then [Previous 12 Months] END

• 7. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Check out the below solution. The workbook is also attached.

• 8. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Nandhakumar Ramanathan wrote:

I created below calculated field but I can see only one bar (selected month) not the 12 months info. Can please you help me here ?

if month([D Rqst1])=[Month Parameter] and Year([D Rqst1])=[Year Parameter] Then [Previous 12 Months] END

Without a sample packaged workbook, I can't really help you because I have no context. I don't know what any of those fields are.

• 9. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Not able to open the attachment as i am using lower version (10.1.1) than yours.

Thanks & Regards,

Nandha

• 10. Re: Change one parameter based on another parameter values selection (Nested Parameter)

OK. Recreated it with 10.1 now. It's attached.

• 11. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Thanks Hari this solves my problem.

Thanks & Regards,

Nandha

• 12. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Will send a sample Tom.

• 13. Re: Change one parameter based on another parameter values selection (Nested Parameter)

Hi Tom,

Please find the sample file attached. Sorry for delay in response as i got some urgent deliverable's in my project.

Thanks & Regards,

Nandha

• 14. Re: Change one parameter based on another parameter values selection (Nested Parameter)

As I wrote above, you need to write a calculated field to combine the parameters.

• First, change your Month Parameter to a string type and change the value from 1 to 01, 2 to 02 etc.
• Change your Year Parameter to a string type as well - make sure the values are straight up 2016, 2017 etc. No commas.
• Create a calculated field called combineddate as DATEPARSE("yyyyMM",[Year Parameter] + [Month Parameter])
• Change your Previous 12 month field, replace your reference to the Year Month Parameter with the combineddate field as above.