Forum Discussion

PeterBartholomew1's avatar
PeterBartholomew1
Silver Contributor
Aug 10, 2021
Solved

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...
  • tboulden's avatar
    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.

Resources