Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I have implemented dynamic update to insert a record within a table or field. But I want to delete not all data but data which is last inserted into the table.is this possible by Dynamic Update ?
to delete the field value I used following delete command
DELETE FROM TestTable WHERE -1
where TestTable is the name of the Table.
DELETE FROM TestTable WHERE peek('Tablename',-1,'keyfieldnameorID');
DELETE FROM TestTable WHERE ID=Max(ID);
it wont work
DELETE FROM TestTable WHERE modifieddate=Max(modifieddate);
Hi,
I believe DELETE is not supported by qlikview you can achieve this by another resident load table see the example load script
You use this expression in the SQL
DELETE FROM TestTable WHERE -1
but this syntax delete all the table data,I want to delete last inserted data.
Try this way suppose there us table and store last record value in the variable r if you have Primary key then use that key
Ex:-
Table1:
LOAD * Inline
[
City,Sales
A, 343454
B, 15482
C, 125659
D, 15823
E, 12563
];
LET vLast = Peek('City' ,-1, 'Table1'); //Here in example last row is E,12563 so we have to delete it from table
NoConcatenate //Then load this resident load without last row
LOAD
City,Sales
Resident Table1
Where not City = '$(vLast)';
DROP Table Table1;
Note:- Load only previous values except the last row.
Hope this helps
This is possible on script editor right,But my requirement is to delete from user interface,I am asking is this possible or not?
Hi Bhawana,
Which version of QV you are using.
Thanks