I think the problem here is in the function you're trying to use. From LastValue - script function ‒ Qlik Sense, this function returns the last value inserted for a group by. The row you're trying to obtain is the first, and with that granularity I think there's no way to obtain only that.
So I would try something like this:
//Determine the max DATUM in the dataset, for each TARIF
max(DATUM) as DATUM
//Keep only the rows that match the data in the TMP table
inner join (TEST1)
//Drop the temporary table
drop table TMP;
Personally I don't like much the LastValue() function, because most of the times there are reviews in the dataset and rows from older dates are inserted.
Let me know if this helps.