ANYIF 函式

基本用法

`pivot value: ANYIF(custId, donation = 10000) group:City limit:1`

語法

`pivot value:ANYIF(col_ref, test_expression) [group:group_col_ref] [limit:limit_count]`

col_ref字串參照您要求取值的資料欄。
test_expression字串用來求取值的運算式，必須解析為 `true``false`

範例

範例 - ANYIF 及 LISTIF 函式

• `ANYIF` - 識別群組中符合特定條件的單一值。請參閱 ANYIF 函式
• `LISTAIF` - 列出群組中符合指定條件的所有值。請參閱 LISTIF 函式

EmployeeIdDateSales
S0011/23/1725
S0021/23/1740
S0031/23/1748
S0011/24/1781
S0021/24/1711
S0031/24/1725
S0011/25/179
S0021/25/1740
S0031/25/17
S0011/26/1777
S0021/26/1783
S0031/26/17
S0011/27/1717
S0021/27/1771
S0031/27/1729
S0011/28/17
S0021/28/17
S0031/28/1714
S0011/29/172
S0021/29/177
S0031/29/1799

`derive type:single value:WEEKDAY(Date) as:'DayOfWeek'`

`DayOfWeek` 中大於 5 的值為週末日。您可以使用下列指令來識別是否有人在工作日 (非週末) 達到這個高標：

`pivot value:ANYIF(Sales, (Sales > 80 && DayOfWeek < 6)) group:EmployeeId,Date limit:1`

`pivot value:LISTIF(Sales, 1000, (DayOfWeek < 6)) group:EmployeeId,Date limit:1`

```["
"]
[]```

EmployeeIdDatelistif_Sales
S0011/23/1725
S0021/23/1740
S0031/23/1748
S0011/24/1781
S0021/24/1711
S0031/24/1725
S0011/25/1740
S0021/25/17
S0031/25/1766
S0011/26/1777
S0021/26/1783
S0031/26/17
S0011/27/1717
S0021/27/1771
S0031/27/1729
S0011/28/17
S0021/28/17
S0031/28/17
S0011/29/17
S0021/29/17
S0031/29/17