Hello,
We have a data mart from which we created a tabular model, which contains a dimensional table for users information, such as gender, name, age, etc.
We have another table called UserIdentity which contains different social identities for our customers, such as email, Facebook account, twitter account, phone number, etc. Here is an example of how this table looks like:
Back to the User table, I need to created a calculated column named CalcEmail that will populate it with the most up-to-date email for the user.
So what I need to do is fetch the IdentityVal where IdentityType is 'email' and the UserKey matches the UserKey of the user. However, the puzzle here for me is how to get the most up-to-date email.
See the example User 4503 (aka 'John'). We have the record of an email for John from 2012 which is 'john@example.com'. However, we have yet a newer one from 03/12/2013 which is 'john.smith@example.com'. So back at the User table, I would like to populate the CalcEmail field with the 'john.smith@example.com' email (the newest) rather then the 'john@example.com'.
I sense the use of the related or userelationship functions, but I am not sure which one, and how to get the latest value. All my attempts so far got bad results.
could someone please advise?
Regards,
P.