Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

claudialet
New Contributor II

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
mark6505
Valued Contributor III

Re: Can link tables be created from SQL SP's ?

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

Highlighted
claudialet
New Contributor II

Re: Can link tables be created from SQL SP's ?

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
New Contributor II

Re: Can link tables be created from SQL SP's ?

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

Community Browser