Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm going through a QV Essentials book, now on a chapter on Mapping tables.
I'm struggling to get my head around how Category_Map is loaded from a text file and then used within another Mapping table without a matching key (lookup value) which in the case of Category_Map would be ProductCategoryID, while SubCategory_CategoryMap wants to retrieve CategoryName using ProductSubcategoryID as a lookup value that doesn't exist in the Category_Map table? The Product table where the mapping tables are applied only contains ProductSubcategoryID.
Any clarification on this would be much appreciated, thanks a lot!
ProductSubcategoryID | ProductCategoryID | SubCategoryName |
1 | 1 | Mountain Bikes |
2 | 1 | Road Bikes |
3 | 1 | Touring Bikes |
4 | 2 | Handlebars |
5 | 2 | Bottom Brackets |
6 | 2 | Brakes |
7 | 2 | Chains |
Product:
LOAD ProductID,
ProductLine,
ProductName,
ProductNumber,
ProductSubcategoryID,
ReorderPoint,
SafetyStockLevel,
StandardCost,
Style,
UnitPrice as ListPrice,
if (ProductLine = 'M', 'Mountain',
if (ProductLine = 'R', 'Road',
if (ProductLine = 'S', 'Accessory', 'Components')) ) as ProductLineDesc,
ApplyMap ('SubCategory_Map', ProductSubcategoryID, 'No SubCategory') as [SubCategory Desc],
ApplyMap('SubCategory_CategoryMap', ProductSubcategoryID, 'No Category') as [Category Desc]
;
SQL SELECT *
FROM Product;
Attaching source files
Hi, Request you to share the source file which is used in the QlikView Essentials book.