Forum Discussion
PeterBartholomew1
Aug 10, 2021Silver Contributor
Array of arrays using Lambda helper functions
Am I missing something? What I want to do is create an array of filtered lists with a single dynamic array formula. The output should be in the form of a 2D array with the shorter lists padded with...
- Aug 11, 2021
PeterBartholomew1Just to get rid of that pesky blank row:
=REDUCE( "", ListCountry#, LAMBDA(acc,val, IF( TYPE(acc)<>64,TRANSPOSE(FILTER(StartList[ATHLETE],StartList[COUNTRY]=val)), VSTACKλ(,acc,TRANSPOSE(FILTER(StartList[ATHLETE],StartList[COUNTRY]=val))) ) ) )
I think since MAP will iterate over an array of any shape, the results have to fit back into the same shape; I'd be interested to know if this is a mistaken assumption on my part.
tboulden
Aug 10, 2021Iron Contributor
PeterBartholomew1Not sure that you can do it with MAP, but REDUCE + VSTACK gets close?
=REDUCE("",ListCountry#,LAMBDA(acc,val,VSTACKλ(,acc,TRANSPOSE(FILTER(StartList[ATHLETE],StartList[COUNTRY]=val)))))