October 26, 2016 at 10:19 pm
Comments posted to this topic are about the item Concatenate and conatenatex
October 26, 2016 at 10:22 pm
I think the answer is 5, can also be considered correct
or am i wrong?
I Have Nine Lives You Have One Only
THINK!
October 27, 2016 at 1:02 am
handkot (10/26/2016)
I think the answer is 5, can also be considered corrector am i wrong?
You're wrong!
CONCATENATE concatenates only two string. CONCATENATE(<text1>,<text2>)
CONCATENATEX concatenates ALL values of a table. See the parameter list:
CONCATENATEX(<table>,<expression>,[separator])
That's very simple!
🙂
October 27, 2016 at 1:44 am
This was removed by the editor as SPAM
October 27, 2016 at 4:46 am
Not being a PowerBI user, I learned something new. Thanks.
October 27, 2016 at 6:22 am
handkot (10/26/2016)
I think the answer is 5, can also be considered corrector am i wrong?
CONCATENATE just pastes two strings (or columns together).
CONCATENATEX is an iterator which goes over an entire table and concatenates all of the values together, using an optional delimiter.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 27, 2016 at 6:23 am
Nice question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 31, 2016 at 3:03 pm
Nice question, but I think the explanation of concatenatex is a bit off - the elements that get concatenated are the results of evaluating the expression parameter on every row of the table denoted (or generated - the table parameter can be an expression instead of a table name) by the table parameter, so the explanation is incorrect unless the scalar expression parameter denotes a column of that table (and sometimes it doesn't). In the example given on the BoL page referenced the expression doesn't designate a column, it generates a scalar value from more than one element of the row it's applied to and it's those scalar values that get concatenated. For the same reason, I think it's a bit off to call the "expression" parameter the "column" parameter.
Obviously concatenatex (T, Exp,D) = concatenate ((select Exp as Cname from T) Tab, Cname , D) [perhaps that's incorrect syntax in DAX, but DAX certainly has an equivalent table expression to the SQL subquery one] which is concatenating all the values in the single column Cname of the generated table, so it's not completely wrong/unacceptable to talk as if the scalar expression were a column name, as the explanation does. Just a bit off and may mislead people into thinking that the second parameter can only be a column name.
Tom
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply