If you are using the max function on top of your date field.. then you have to aggregate it using group by on some field.
this must be something like:
Max(Date) as maxdate
group by CDARML;
I am not clear with your logic.. to get the latest value.. for example
article no 2300 has same date, on what base you are having 3 PRZVND
I tried you suggestion, but qlikvew return an error for INVALID EXPRESSION ... please see the following script (of course there are much more fields that at the beginning of the discussion I didn't mentioned 'cause not of your interest, or at least, not of interest for the discussion); furthermore the old DTFINL now is DTLVML and the old PRZVND is now PRZLML2 (sorry, but when I posted the question I was out of office and I wrote from memory!)
MAX (Date ( (Date#([DTUAML],'YYYYMMDD')), 'DD/MM/YYYY')) AS LASTDATE,
[\\psf\Home\Desktop\stp mov magazzino\ANALISI_MAG_FER\FER60DAT_MGLIS01F.txt]
(txt, codepage is 1252, embedded labels, delimiter is ';')
WHERE(CLISML = 001 And DTLVML = 0)
GROUP BY ([CDARML])
Anil, you are right, I'm sorry, I copied in my question the wrong code: the Where condition is "Where (DTFINL = 0 AND CLISML = 001).
Sushil .... I explain the logic: CLISML identify the price list, where 001 is the purchase price, while 1240xxx is the n sale price list (n because it could happen that different client has different discount, so different price). I'm interested only to the purchase price, that is why I put the condition Where CLISML = 001.
Then, as regard date, when we insert a new article, let suppose 12470, the system database record the input date (in my example DTUAML 20150415, and at the same time the final date of validity DTFINL of that price is 0); next time we input a variation of the price, the original final date of validity DTFINL is updated with the new input, in my example 20160201, and a new recod is created with the new price and its starting date ( 20160202) togethere the final date ( DTFINL 0).... in the example table I wrote you see the updated situation as above described.
So if all the above is clear (sorry for my bad english), it would be clear that my purpose is to load, for each article CDARML, the most recent purchase price (price list CLISML 001), and the most recent has DTFINL = 001 and younger starting date
In any case now I try to group as suggested by Sushil
will let you now shortly