Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
claudialet
Contributor III
Contributor III

Can link tables be created from SQL SP's ?

So here are tables from SQL EXEC  SP's  that forms synthetic keys.

What is the best way to create link table to eliminate synthetic keys from a SQL EXEC commands ?

[Sales ] :

Sales ID

Order ID

Customer ID

[Orders] :

OrderID

CustomerID

ProductID

[Product]:

ProductID

OrderID

Sales ID 

3 Replies
Mark_Little
Luminary
Luminary

Hi,

Really would need to see what the data was and get an understanding of what you are trying to do.

But generally you would alias the fields, you do not want to link on, leaving just one field linking two of the tables Some like

[Sales ] :

Sales ID

Order ID

Customer ID          AS  Sales.CustomerID

[Orders] :

OrderID

CustomerID

ProductID

[Product]:

ProductID

OrderID          AS Product.OrderID         

Sales ID           AS Product.SalesID.

Would get rifd of your synthetic keys. Byt not knowing the Data is maybe you need to make concatenated keys to get the correct joins.

Mark

claudialet
Contributor III
Contributor III
Author

All the tables are being pulled from SP's

  SQL EXEC [Reports].Report.[USP_GetSales];

  I need to join all tables by a [%Key field] not just rename them

hectormunoz
Contributor III
Contributor III

Hi, you can use precedent load like this

Load

Field1,

Field2 as %KEY_SOMETHING

;

SQL EXEC [Reports].Report.[USP_GetSales];


be sure to respect the actual field names from the SP response.


Regards