Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help working with linked data from two SQL databases in Direct Query mode

I am working from 2 SQL server sources using DirectQuery. In SQL server A, Event_ProductID is an integer, and in SQL Server B, "productID" is a string but it should be a matching field between the two and it did allow me to make a 1 (product table) to many (event table) relationship, but it's not letting me create visuals with both of these tables contributing columns. 

 

The 'Product' table comes from SQL server A and has the following columns:

Cost, Name, productID

 

The 'Event' table comes from SQL server B and has the following columns:

EventOwner, Event_ProductID, Event_SessionName, Event_Location

 

I was thinking i could maybe make a new table with productID, name, EventOwner and Event_SessionName and use that for my visualisations but the RELATED function doesn't seem to be working and I'm a bit stuck at this point.

 

Any advice on how to make a new table referencing both these tables and converting productID to an integer on the fly?

  • Anonymous's avatar
    Anonymous
    5 years ago

    What I was really looking for was the function LOOKUPVALUE. All sorted now, thanks!

3 Replies

  • Anonymous , if the product ID is not unique in one of the tables you will get M-M to join. You can have a table in import mode (composite mode) and use that. Create a product table in import mode and use that with both databases.

  • Anonymous's avatar
    Anonymous
    Not applicable

    What I was really looking for was the function LOOKUPVALUE. All sorted now, thanks!