Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends
I want to remove last Date records from Table Dynamically
Eg:
Date
01/01/2016
02/01/2016
03/01/2016
Here I need to remove 03/01/2016. I need to do this dynamically why because after some time the date may be change. Guys can u please help me on this
Thanks & Regards
Abi
have you tried
Max(date)-1
Can you tell us what is the purpose of removing last date ? Do you want to achieve it from front end or back end?
Hi,
Try like this
Temp:
LOAD
Date,
'
'
'
FROM DataSource;
Left JOin(Temp)
LOAD
Max(Date) AS Date,
1 AS Flag
RESIDENT Temp;
Data:
Noconcatenate
LOAd
*
RESIDENT Temp
WHERE Flag <> 1;
DROP TABLE Temp;
Hope this helps you.
Regards,
Jagan.
max(date)-1
Try like:
Temp:
LOAD
Max(Date) as MxDate
FROM DataSource;
let vMaxDate = peek('Date', 0,'Temp');
Drop table Temp;
FinalTab:
Load *
FRM DataSource
Where Date < $(vMaxDate);
Try this -
t1:
Load * inline [
Date
01/01/2016
02/01/2016
03/01/2016 ];
Let vLast = FieldValue('Date',NoOfRows('t1'));
NoConcatenate
t2:
Load *
Resident t1
Where Date<>'$(vLast)';
DROP Table t1;
Hi,
Try:
Max(Date_Field ) as Latest_Date
and later
where Date_Field <> max(Date_Field);
Thanks
AS
@Jagan
I think you need:
Data:
Noconcatenate
LOAd
*
RESIDENT Temp
WHERE Flag <> 1 Or IsNull(Flag);
@Jonathan
I guess
....
WHERE Flag <> 1 alone is good enough here. Am I missing something? The Isnull() would be implicit here.