Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi, i use min & max function to find min & max date values before calendar build
than put it into a variable with peek
recently read here : http://www.learnqlickview.com/qlikview-tutorial-a-how-to-tip-on-data-load/
that its more effective to sort the date than peek .. it works for the min but not for the max
tried it like this:
LOAD
DATE
Resident ACCOUNTS Order By DATE desc;
LET varMinDate = Num(Peek('DATE ', 0, 'minmaxdate'));
LET varMaxDate = Num(Peek('DATE ',-1, 'minmaxdate'));
any ideas?
A even better way to do this would be to use FieldValue function. Check out here: “Fastest” Method to Read max(field) From a QVD | Qlikview Cookbook
try this
aa:
LOAD
DATE
Resident ACCOUNTS Order By DATE desc;
noconcatenate
bb:
load max(DATE ) as max_data,
min(DATE ) as min_data
resident aa;
LET varMinDate = Num(Peek('min_data', 0, 'bb'));
LET varMaxDate = Num(Peek('max_data ',0, 'bb'));
drop table aa;
thank you, but i'm trying to avoid min & max function
solved with SQL statement directly from the table min & max works good, faster then resident ..
-------
OLEDB CONNECT TO ...
minmaxdate:
SQL
select
max(date) as maxdate,
min(date) as mindate
from orders;