Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Tell us which business and trade publications you read most regularly: RESPOND NOW
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;