FirstSortedValue(Qty, -Date) as Qty
(html, codepage is 1252, embedded labels, table is @2)
Group By ID;
(html, codepage is 1252, embedded labels, table is @1);
Left Join (Table)
(html, codepage is 1252, embedded labels, table is @2);
Price * Qty as Sales;
If(IsNull(Qty), ApplyMap('Mapping', ID), Qty) as Qty
DROP Table Table;
Community_191846.qvw 148.2 K
I think you want to find a match in price table with the latest date <= the date in the qty table, so a fixed mapping based on ID only will not work for a history of qty data.
HIC has blogged a lot about these problems and also created some tech docs.
Here you find several approaches including generating the missing price records in the data model and INTERVALMATCH approaches.
You might also want to look at this sample:
Qlikview Cookbook: Expand A Pricing Date Table http://qlikviewcookbook.com/recipes/download-info/expand-a-pricing-date-table/