JoinAcross question with combined keys
Unfortunately, JoinAcross
does not presently (V11.1) support any form of computed key specification. We have no choice but to adjust the first dataset to include the full name.
We do not necessarily have to go so far as to destructively alter d1
-- we can add the computed column in an inline query:
JoinAcross[
d1[All, <| "fullname"-> #first~~" "~~#last, # |> &] // Normal
, d2 // Normal
, Key["fullname"] -> Key["fullname"]
] // Dataset
As an aside, in later versions of Mathematica we can usually omit the applications of Normal
, Key
and Dataset
:
JoinAcross[
d1[All, <| "fullname"-> #first~~" "~~#last, # |> &]
, d2
, "fullname" -> "fullname"
]
... but be prepared to add them back in since JoinAcross
has been very finicky across releases (especially when applied to datasets).