# Filtering loop elements on their value

Use a SimpleLoop function with a Greater function to filter elements in a loop based on their value.

## Before you begin

You have created a map with an input and output structure. You can use the sample provided below.

## About this task

In this example, you have a CSV file containing employee information, including salaries. You want to filter this data to keep only the employees with a salary above 150. You can use the following CSV sample to create a structure and use it as both input and output in your map:

```
firstName,lastName,salary
Steve,Rogers,185
Tony,Stark,200
Natasha,Romanoff,175
Bruce,Banner,150
Clint,Barton,135
```

## Procedure

1. Place the input row element on the corresponding output to map all child elements.

   A SimpleLoop function is automatically added to the output row loop. ![Placement of row element.](https://help.qlik.com/talend/en-US/data-mapper-functions-reference-guide/Resources/images/filter_by_value_01_simpleloop.png)
2. Place a Greater function on the Filter argument of the SimpleLoop.
3. Place the input salary element on the First Value argument.
4. Place a Constant function on the Second Value argument.
5. Double-click the Constant function and enter 150 in the Value field, then click OK.

## Results

Your map is configured and looks like this: ![Map result.](https://help.qlik.com/talend/en-US/data-mapper-functions-reference-guide/Resources/images/filter_by_value_02_filter.png)

You can use the Test Run feature to see the result. In this example, the following output is returned:

```
firstName,lastName,salary
Steve,Rogers,185
Tony,Stark,200
Natasha,Romanoff,175
```