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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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;