# Creating a filter using a validation rule

Use a ValidateGroup function to filter out rows containing an invalid element.

In this example, create a filter to display only the employee in the Denver location.

## Procedure

1. Select the row (0:\*) element from the Input (XML) table and open the Validate tab.
2. From the Functions tab, select ValidateGroup and drop it in the Validate tab.
3. Double-click on ValidateGroup.
   1. Enter TEST in the Message field.
   2. Enter a number, for example, 11.
4. In the Data section, drag-and-drop the input element that you want to validate. In this example, use Location.

   ![](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/tdm_validategroup.png)
5. Select Location from the Input (XML) table and open the Validate tab.
6. Insert a validation function that returns a Boolean. In this example, select the Contains function from the Functions palette.
7. Double-click Contains and enter Denver.
8. Drag-and-drop the Location element from the Input (XML) table in the Input Value section.

   ![](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/tdm_validatelocation.png)
9. Select the row (0:\*) element from the Output (XML) tab.
10. In the SimpleLoop, add the IsValid function in Filter section.

    ![](https://help.qlik.com/talend/en-US/data-mapper-user-guide/Resources/images/tdm_validateisvalid.png)
11. Click Test Run to display the employee in Denver.