Pick function

Returns elements of a data field that correspond to a condition


Description

The Pick function searches for all items in a list or table that match a specific condition. The condition is formulated in the second parameter.


Condition

The condition is passed in a text string. The string "# < 5" searches for all elements whose value is less than 5. The rhombus stands here as an icon for the list or table being searched.


Lists

In the case of lists, the result is also a list in which only the elements corresponding to the condition are contained.


Tables

If the first argument is a table, the third argument must be the number of a column to search. The result is a table that contains the rows whose reference column matches the condition.


Syntax

Pick (list, "# < x")

Pick (table, "# < x", column)

Examples

In the first example below, the results contain the values ​​that are less than 5 in the result.

In the second example, the result is the lines whose value in the 2nd column is less than 5.

Comparison operators and input via keyboard

      Enter keys  
  less than  
  greater than  
  less or equal <=  
  greater or equa >=  
  equal ==  
  unequal <>