Skip to main content
The way to achieve your own success is the willingness to help somebody else. Go for it!
Showing results for 
Search instead for 
Did you mean: 
Creator II
Creator II

Convert Mapping Table....ApplyMap to SQL code

How can we write equivalent logic in SQL for apply map used in qlik sense script?

1 Reply

Hi, I'm far from being an expert in SQL, maybe there is a better way but you can use subselect to simulate mapping tables:

SELECT Ord.SalesOrderID, Ord.OrderDate,
    (SELECT MAX(OrdDet.UnitPrice)
     FROM Sales.SalesOrderDetail AS OrdDet
     WHERE Ord.SalesOrderID = OrdDet.SalesOrderID) AS MaxUnitPrice
FROM Sales.SalesOrderHeader AS Ord;