From my understanding, within a LET formula, the letters x and q are like variables, then only become what you define them as. for example:
Formula:
x,UNIQUE(Table1[Name])
Will mean that the value of x becomes the below:
A
B
C
D
So x is an array of values and not just one.
With that in mind, when you use the BYROW function, it requires a LAMBDA in order to loop through the values of x. For example:
Formula:
BYROW(x,LAMBDA(q
In the above, the q becomes A then B then C then D as the LAMBDA loops through the values of x.
So the LAMBDA part is doing a TEXTJOIN using each value within x by looking up the values in your table, so it finds:
A - China, SG
B - SG, Msia
Etc..
The formula then stacks horizontally, the result of x and then the results for the TEXTJOIN's.
Sorry if this is not clear, this is the way I learned how the LAMBDA works, I actually come from a VBA coding background.
As for the formula to convert the values back, the below could be an option, although there may be many variations that do the same:
Formula:
=LET(a,Table3[DDD],b,Table3[EEE],x,TEXTJOIN("",TRUE,REPT(a&", ",LEN(b)-LEN(SUBSTITUTE(b,",",""))+1)),HSTACK(TEXTSPLIT(LEFT(x,LEN(x)-2),,", ",TRUE),TRIM(TEXTSPLIT(TEXTJOIN(",",TRUE,b),,","))))
Bookmarks