Forum Discussion
Anonymous
7 years agoNot applicable
Combine two arrays, alternating their elements
I'm thinking how one would go about doing this in PQ. Input : arr1[] = {1, 2, 3, 4, 5, 6}
arr2[] = {11, 22, 33, 44}
Output: {1, 11, 2, 22, 3, 33, 4, 44, 5, 6}
Input : arr1[] = {1, 2, 3,...
- 7 years ago
Assuming the arrays are list objects in the Query editor, you can use this function:
List.Select(List.Combine(List.Zip({Array1, Array2})), each _ <> null)
ImkeF
Community Champion
7 years agoAssuming the arrays are list objects in the Query editor, you can use this function:
List.Select(List.Combine(List.Zip({Array1, Array2})), each _ <> null)
rohanjaiswal
6 years agoFrequent Visitor
Output: {1, 11, 2, 22, 3, 33, 4, 44, 5, 6}ImkeF How to get each combination into separate row ?
| ID | value |
| 1 | 1,11 |
| 2 | 2,22 |
| 3 | 3,33 |