Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

how to convert to a linked table SalesOrderHeader/Detail and Producttable? basic question

below code gives me the right values. But now i want to convert it to a linked table structure.. how is that done?

SalesOrderHeader:
LOAD SalesOrderID,
SalesOrderID AS %SalesOrderID_Key,
RevisionNumber,
OrderDate,
Status,
OnlineOrderFlag,
SalesOrderNumber,
PurchaseOrderNumber,
AccountNumber,
CustomerID,
TerritoryID,
BillToAddressID,
ShipToAddressID,
ShipMethodID,
TaxAmt,
Freight,
LocalCurrency;
SQL SELECT *
FROM SalesOrderHeader;

LEFT JOIN

LOAD SalesOrderID,
SalesOrderID AS %SalesOrderID_Key,
SalesOrderDetailID,
ProductID,
ProductID AS %ProductID_Key,
SpecialOfferID,
UnitPrice,
OrderQty,
OrderQty * UnitPrice AS OrderTotal,
UnitPriceDiscount,
CarrierTrackingNumber,
DueDate,
ShipDate
;
SQL SELECT *
FROM SalesOrderDetail;

Product:
LOAD
ProductID AS %ProductID_Key,
Name,
ProductNumber,
MakeFlag,
FinishedGoodsFlag,
Color,
SafetyStockLevel,
ReorderPoint,
StandardCost,
ListPrice,
Size,
SizeUnitMeasureCode,
WeightUnitMeasureCode,
Weight,
DaysToManufacture,
ProductLine,
Class,
Style,
ProductSubcategoryID,
ProductSubcategoryID AS %ProductSubcategoryID_Key,
ProductModelID,
SellStartDate,
SellEndDate,
DiscontinuedDate
;
SQL SELECT *
FROM Product;

LEFT JOIN (Product)

LOAD ProductSubcategoryID,
ProductSubcategoryID AS %ProductSubcategoryID_Key,
ProductCategoryID,
ProductCategoryID AS %ProductCategoryID_Key,
Name
;
SQL SELECT *
FROM ProductSubcategory;


LEFT JOIN (Product)

LOAD ProductCategoryID,
ProductCategoryID AS %ProductCategoryID_Key,
Name
;
SQL SELECT *
FROM ProductCategory;

0 Replies