Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
ramkrishna86
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
rubenmarin

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;