Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I wish to pick the i'th element of a concatenated selection
=pick(1, concat( [Field], ', ' ))
I would have thought that I should be possible however, currently the second argument is interpreted as a single argument and not as many.
Is my approach possible and am I just missing something?
Hi Christoph,
Try this. You can use distinct inside the concat function, if you have duplicate values in the input field.
=Pick(1, $(=Concat( Chr(39) & [Field] & Chr(39), ', ')))
You can use something like below..
=SubField(Concat(DISTINCT [Field],', '),',',1)
//The above one is for picking 1st item
=SubField(Concat(DISTINCT [Field],', '),',',2)
// This is for 2nd item and so on
Hi Christoph,
Try this. You can use distinct inside the concat function, if you have duplicate values in the input field.
=Pick(1, $(=Concat( Chr(39) & [Field] & Chr(39), ', ')))
Yes. This was the combination I was looking for.
Is there a distinction between the two?
Sorry. Which two you are asking?
=Pick(1, $(=Concat( Chr(39) & [Field] & Chr(39), ', ')))
vs
=SubField(Concat(DISTINCT [Field],', '),',',1)
Iterating on that, I would like to use that further so that I can use the single value in some elaborate expression:
Something like:
=only({$<[Field]={$(=SubField(GetFieldSelections( [Field],', ',3),',',1))}>} [Field])
But I do not understand the parsing of expressions good enough yet.
Both will show the same result. If you want to check how it is working, you can create a straight table and leave the dimension tab blank and add your expression like below. This way you can easily identify how the expression is parsing the value and debug your expression if required.
BTW, you have to add single quotes.
=only({$<[Field]={'$(=SubField(GetFieldSelections( [Field],', ',3),',',1))'}>} [Field])
If you got the solution, please close the thread by marking correct and helpful answers.
Thank you, the placement of char(39) is still a mystery to me.
Interestingly, it appears that I cannot select the second element
=only({$<[Field]={'$(=SubField(GetFieldSelections( [Field],', ',3),',',2))'}>} [Field])
What am I missing here?