Discussion Board for collaboration on QlikView Scripting.
Can anyone explain this!
I have a table loaded as below
If I put this field in a list box and sort by 'load order' and show frequency I only have single values in the order shown above.
I have lines in my scrips as below:
let vRepDate = Peek('MxDate', 0);
let vRepDatePrior= Peek('MxDate', 1);
This returns vRepDate = 43008 (correct)
but vRepDatePrior = 42916 !!
I don't understand....
Go to Solution.
The DISTINCT qualifier can mix up your output table rows, so the resulting MxDate table is not sorted in descending order ( the order by clause is only affecting the Input table).
Have a look at the table view table preview to see what I am talking about.
I can't reproduce this behaviour with the Information provided.
LOAD * INLINE [ MxDate 43008 42978 42916 ]; let vRepDate = Peek('MxDate', 0); let vRepDatePrior= Peek('MxDate', 1);
How is your field MxDate created?
I'm creating it as follows:
Load Distinct Num(Date) as MxDate Resident Performance order by date desc;
Ah yes, I forgot about that! Thanks.