Discussion Board for collaboration on QlikView Scripting.
I need you help with small problem.
I have excel like this:
My question is how do I select only the last value?
I need that in script, not in expressions
Thanks in advance
Go to Solution.
You need to look at peek function.
You can put an counter, and use RecNo() function
Load *, RowNo() as RowNum from <>;
Load * Resident Table1 where RowNum=$(vMax);
Drop Table Table1;
Table1:load * inline [
let vLastA = Peek('A', -1,'Table1');
let vLastB = Peek('B', -1,'Table1');
load '$(vLastA)' as A, '$(vLastB)' as B autogenerate 1;
drop table Table2;
Another way of getting the last record and keeping it in a variable.
load * Inline [
let vLastRecords = Peek('B',NoOfRows('tab')-1,'tab'); // can have another variable for field A