

# Conditional rules


This feature is currently available with the **Free-form** layout. Conditional rules are used to hide or show visuals when specific conditions are met. This can be useful when you have multiple versions of the same visual overlapped with each other and want the dashboard viewer to see a version that best represents the parameter value they select. 

Conditional rules use parameters and parameter controls to hide and show visuals. Parameters are named variables that can transfer a value for use by an action or an object. This feature supports string and number parameters. To make the parameters accessible to the dashboard viewer, you add a parameter control. A parameter control allows users to choose a value to use in a predefined filter or URL action. For more information about parameters and parameter controls, see [Parameters in Amazon Quick](parameters-in-quicksight.md).

Use the sections below to set up and use conditional rules.

**Topics**
+ [

# Hiding a visual by default
](hiding-a-visual-by-default.title.md)
+ [

# Setting a conditional rule
](setting-a-conditional-rule.title.md)
+ [

# Using conditional rules
](using-conditional-rules.md)

# Hiding a visual by default


In the **Interactions** pane of the **Properties** pane, you can choose to hide a visual by default. Doing this can be useful if you want the viewer to only see visuals based on specific conditions.

**To hide a visual by default**

1. From the Quick homepage, choose **Analyses**, and then choose the analysis that you want to customize.

1. Choose the visual that you want to add a rule to.

1. On the menu in the upper-right hand side of the visual, choose **Properties**.

1. In the **Properties** pane that opens, choose **Interactions** and open the **Rules** dropdown.

1. In the **Rules** menu, choose **Hide this visual by default**.

Hidden visuals appear fully hidden in a viewing dashboard. In the **Analyses** pane, hidden visuals are visible with the message “Hidden based on rule”. With this display, you can see where all of a dashboard's visuals are located.

**Note**  
You can't create conditional rules that hide visuals that are already hidden by default or that show visuals that already appear by default. If you change the default appearance of a visual, existing rules that contradict the new default appearance will be disabled.

# Setting a conditional rule


When you set up a conditional rule, you create a conditional statement that will hide or show a visual when a specific condition is met. You can currently create conditional rules that hide or show a visual. If you want to create a conditional rule that makes a hidden visual appear, choose **Hide this visual by default** in the **Rules** menu of the **Properties** pane. 

**Note**  
Before you begin, make a parameter and a corresponding parameter control to base your new conditional rule on. Supported parameters are string parameters and number parameters. For more information about parameters and parameter controls, see [Parameters in Amazon Quick](parameters-in-quicksight.md).

**To set a conditional rule**

1. From the Quick homepage, choose **Analyses**, and then choose the analysis you want to customize.

1. Choose the visual that you want to add a rule to.

1. On the menu in the upper-right hand side of the visual, choose **Properties**.

1. In the **Properties** pane that appears on the left, choose **Interactions**, and then choose **Rules**.

1. Choose **ADD RULE**.

1. In the first menu in the **Add rule** pane, choose the parameter you want.

1. In the second menu in the **Add rule** pane, choose which condition you want. For string parameters, supported conditions are **Equals**, **Starts with**, **Contains**, and **Does not equal**. For number parameters, supported conditions are **Equals**, **Starts with**, **Contains**, and **Does not equal**.

1. Enter the value you want the conditional rule to meet.
**Note**  
Values are case-sensitive.

1. Choose **Add rule** to apply the new conditional rule to the visual. To cancel the rule, choose **Cancel**.

Conditional rules can also be edited and deleted. 

**To edit a conditional rule**

1. On the menu in the upper-right hand side of the visual, choose **Properties**.

1. In the **Properties** pane that appears on the left, choose **Interactions**, and then choose **Rules**.

1. Choose the menu icon on the right-hand side of the rule you want to edit, and choose **Edit**.

1. Make the changes that you want and choose **Save**.

**To delete a conditional rule**

1. On the menu in the upper-right hand side of the visual, choose **Properties**.

1. In the **Properties** pane that appears on the left, choose **Interactions**, and then choose **Rules**.

1. Choose the menu icon on the right-hand side of the rule you want to edit and choose **Delete**.

# Using conditional rules


Once you have set up a conditional rule that is connected to a parameter and a parameter control, you can use the parameter control to enable or disable the conditional rules you have set. 

**To enable a conditional rule**

1. From the Quick homepage, choose **Analyses**, and then choose the analysis you want to customize.

1. On the **Controls** bar at the top of your workspace, choose the dropdown icon.

1. Choose the parameter control associated with the conditional rule you created.

1. Choose the value associated with the conditional rule that you created from the parameter's menu. You can also enter the value that you want into the **Search value** box.
**Note**  
Values are case-sensitive.

   Selecting the correct value causes the visual to appear or disappear depending on the rule you set.

You can also bring a parameter control to the sheet your visual is on. This is useful when you want a parameter control to be next to the visual it is associated with or when you want to add a conditional rule to the control so it appears only when specific conditions are met. 

**To bring a parameter control to a sheet**

1. From the Quick homepage, choose **Analyses**, and then choose the analysis you want to customize.

1. On the **Controls** bar at the top of your workspace, choose the control that you want to move.

1. At the upper right-hand side of the control, open the **Menu options** menu. 

1. Choose **Move to sheet**.

**To move a parameter control back to the Controls bar**

1. On your dashboard, select the parameter control you want to move. 

1. On the upper right-hand side of the control, open the **Menu options** menu. 

1. Choose **Move to top of sheet**. 