ARRAYUNIQUE 函式

• 輸入內容為資料欄名稱或陣列文字。
• 如果某元素在一或多個陣列中出現兩次，則輸出陣列只會列出該元素一次。

基本用法

`derive type:single value:ARRAYUNIQUE([["A","B"],["A","C"]] )`

`["A","B","C"] `

`derive type:single value:ARRAYUNIQUE([array1]) as:'unique_Array1'`

`derive type:single value:ARRAY UNIQUE ([array1,array2]) as:'unique_Array2'`

語法

`derive type:single value:ARRAY UNIQUE (array_ref1,array_ref2)`

array_ref1字串或陣列要套用至這個函式的第一個資料欄名稱或第一個陣列常值
array_ref2字串或陣列要套用至這個函式的第二個資料欄名稱或第二個陣列常值

範例

範例 - 簡易 Unique 範例

• `ARRAYCONCAT`：將多個陣列互相串聯，請參閱 ARRAYCONCAT 函式
• `ARRAYINTERSECT`：在多個陣列之間找出元素交集，請參閱 ARRAYINTERSECT 函式
• `ARRAYCROSS`：計算多個陣列的交叉乘積，請參閱 ARRAYCROSS 函式
• `ARRAYUNIQUE`：產生多個陣列中的不重複值，請參閱 ARRAYUNIQUE 函式

ItemArrayAArrayB
Item1`["A","B","C"]``["1","2","3"]`
Item2`["A","B"]``["A","B","C"]`
Item3`["D","E","F"]``["4","5","6"]`

`derive type:single value:ARRAYCONCAT([Letters,Numerals]) as:'concat2'`

`derive type:single value:ARRAYINTERSECT([Letters,Numerals]) as:'intersection2'`

`derive type:single value:ARRAYCROSS([Letters,Numerals]) as:'cross2'`

`derive type:single value:ARRAYUNIQUE([Letters,Numerals]) as:'unique2'`

ItemArrayAArrayBconcat2intersection2
Item1

`["A","B","C"]`

`["1","2","3"]``["A","B","C","1","2","3"]``[ ]`
Item2`["A","B"]``["A","B","C"]``["A","B","A","B","C"]``["A","B"]`
Item3`["D","E","F"]``["4","5","6"]``["D","E","F","4","5","6"]``[ ]`

Itemcross2
Item1`[["A","1"],["A","2"],["A","3"],["B","1"],["B","2"],["B","3"],["C","1"],["C","2"],["C","3"]]`
Item2`[["A","A"],["A","B"],["A","C"],["B","A"],["B","B"],["B","C"]]`
Item3```[["D","4"],["D","5"],["D","6"],["E","4"],["E","5"],["E","6"], ["F","4"],["F","5"],["F","6"]]```

Itemunique2
Item1`["A","B","C","1","2","3"]`
Item2`["A","B","C"]`
Item3```["D","E","F","4","5","6"] ```

傳送您對下列選項的寶貴意見...

Google Cloud Dataprep 說明文件