I would like to join associations in the following way. Say I have a dataset d1:
keys1 = {"first", "last", "age"}; first = {"Mike", "Carl", "Tina"}; last = {"Shulz", "Miller", "Ruben"}; age = {28, 35, 34}; then
d1 = Dataset[ AssociationThread[keys1, #] & /@ ({first, last, age}\[Transpose])] and a second dataset
names = d1[All, {"first", "last"}][All, #first ~~ " " ~~ #last &] // Normal (*{"Mike Shulz", "Carl Miller", "Tina Ruben"} *) and
income = {30000, 23000, 40000} so the dataset d2 is
d2 = Dataset[ AssociationThread[{"fullname", "income"}, #] & /@ ({names, income}\[Transpose])] Then I would like to combine (join) these datasets on the full name of a person, which is present in the second dataset but not in the first. Something like
JoinAcross[Normal@d1, Normal@d2, (Key["first"] ~~ Key["last"]) -> Key["fullname"]] (clearly) does not work. Is there an easy way to achieve the desired result (without modifying the first dataset and append a full name on it)?
Edit:
Besides the question is answered by a good workaround another questions arises: "Why the coloring"? I tried the solution from WReach - works fine, but I get parts of the answer colored and do not know why... Can someone help (again)?... Sorry, I just saw it: missing braces {}....


