If a QlikView reload script contains a Load Distinct statement from a data source followed by a Resident Load, then QlikView 12.x returns a different data load order than QlikView 11.20. This may cause problems when Load Distinct and Resident Load are used to create mapping tables. Different sorting in the mapping tables result in different data mappings between the versions when multiple return values per lookup exists.
For example, for the following piece of script:TempTable:
LOAD * INLINE [
recNo() as RecNo,
rowNo() as RowNo
//Order By Code //Uncomment this line to get the same load order in QlikView 11.20 and 12
drop table TempTable;
Different load orders are returned in QlikView 11.20 and 12.x:
From version 12, QlikView applies the new column-based data architecture replacing the old row-based one in 11.x. DISTINCT keyword requires a sort, and sorting order is different between the two architectures. This change of behavior is by designed.
To avoid this difference, the solution is to establish a well-defined sort order using the ORDER BY clause. In the above example, adding Order By Code to the Resident Load statement returns the same same load order in QlikView 11.20 and 12.