Hàm select trong AppSheet

SELECT(Students[First Name], TRUE, FALSE) returns a list of first names (possibly with duplicates) of all students. Equivalent to Students[First Name].

SELECT(Students[First Name], ([Class of] = "2020"), FALSE) returns a list of first names (possibly with duplicates) of the students of the class of 2020. Equivalent to SELECT(Students[First Name], ([Class of] = "2020")).

SELECT(Students[First Name], ([Class of] = "2020"), TRUE) returns a list of distinct first names (duplicates omitted) of the students of the class of 2020.

SELECT(Orders[Order ID], ([Customer] = [_THISROW].[Customer])) returns orders for this customer. More specifically, it returns the Order ID column values (the row keys) for rows in the Orders data set in which the

SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
0 column value is equal to the
SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
0 column value of the current form. Equivalent to
SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
2. See also:
SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
3

SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
4 returns the distinct names of products priced less than $100.

Syntax

SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
5

  • SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
    6 - The specification of the table or slice (the "data set") to search and the column from which values are to be gathered, in the form:
    SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
    7. For example,
    SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
    8. Although identical in appearance to a column list expression, this argument is not an expression.
  • SELECT(Order Details[Description], ([Order ID] = [_THISROW].[Order ID]), TRUE)
    9 -  A SELECT(Students[First Name], TRUE, FALSE)0 expression, evaluated for each row of the data set, that returns SELECT(Students[First Name], TRUE, FALSE)1 or SELECT(Students[First Name], TRUE, FALSE)2 indicating whether the column value from the row should be included (SELECT(Students[First Name], TRUE, FALSE)1) or excluded (SELECT(Students[First Name], TRUE, FALSE)2) in the results.
  • SELECT(Students[First Name], TRUE, FALSE)5 - A SELECT(Students[First Name], TRUE, FALSE)0 expression. Set to SELECT(Students[First Name], TRUE, FALSE)2 to indicate the results list should include all values found in selected rows, or SELECT(Students[First Name], TRUE, FALSE)1 to indicate duplicate values should be omitted. If not given, SELECT(Students[First Name], TRUE, FALSE)2 is assumed.

Troubleshoot

Within the second argument, the Students[First Name]0 expression, any column references are interpreted from the perspective of the data set being searched, not that of the data set from which the expression is run. In order to reference columns from the current row, you must dereference Students[First Name]1.

For example, consider this attempt from an order row to get the item descriptions from the order detail rows:

SELECT(Order Details[Description], ([Order ID] = [Order ID]), TRUE)

The goal is to select rows from the Students[First Name]2 data set with an Order ID column value that matches this order's own ID. But within the Students[First Name]0 expression (Students[First Name]5), both column references refer to the Students[First Name]2 row being examined. As written, the expression will always be SELECT(Students[First Name], TRUE, FALSE)1.