Discussion Board for collaboration on QlikView Scripting.
PFA the test data (a single column) that is not getting sorted when we write the following code:
(biff, embedded labels, table is Sheet1$);
load distinct * Resident D
Order by x;
drop Table D;
I know that Order By executes before Load. Thus accordingly, Load Distinct should be applied on the sorted column x which should in turn return the sorted Distinct values.
It would be really helpful if you could help me tell why it is not getting sorted.
It´s a known behavior.
There´s one idea about future versions
Thanks Clever Anjos. However, I am intrigued about the code library that runs for Distinct Clause. Can we get the code for it anywhere ?
I don´t think it´s available since is proprietary code from Qlik
As a workaround to keep the sort order, you can use something like
LOAD x as xTemp
LOAD xTemp as x
WHERE NOT EXISTS(x,xTemp)
ORDER BY xTemp;
DROP TABLE TMP;
can you please explain you solution? What I find confusing is that the 1st parameter of exists is x, even though it was renamed in TMP to xTemp.
Exists(field_name [, expr])
Thank you in advance,