Discussion Board for collaboration on QlikView Scripting.
Hello! Can someone explain me, please, why does
//Date is a field of previously loaded table
cause a script line error?
Go to Solution.
Hi, try this.
You should use following expression:
Hope this helps.
Andrei, tahnks for your reply. But it doesn't work/ the same error=(
check this one
let vmax = MonthStart(Peek('DateOfSale', -1));
So, you can try this construction:
LOAD * INLINE [
max(Date) as MaxDate
LET vMonthStart = MonthsStart(PEEK('MaxDate'));
drop table temp;
Max (Date) as MaxDate
LET vMonthStart=MonthStart(FieldValue('MaxDate', 1));
I made like this
Let vMaxDateNum = Num( Peek( 'MaxDate', 0, 'TempTable1'));
Let vMaxDate = Date( $(vMinDateNum));
LET vPeriod=$(vMaxDate)-$(vMonthStart);// to tell the truth, THIS variable is what I need
There is no error.
But it DOESNT WORK=((( only first variable is ok. I cant see other variables in my option of document....
what can be wrong?=(
and make sure, your dates are sorted ascending
Can you post a sample
can you post an example? Peek should work for you. Though the 'max' won't work in the let like that, as peek only returns a single value, so max won't do anything.
You'll either need to load a new date field to use with the max within it, or ensure you data is order by date, so you can peek the last/first row depending on your ordering.
hope that helps