Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
KeyDate:
LOAD
Id,
max([KeyDate]) as KeyDate
FROM
group by Id;
I have this script to just pull max date fro each ID and when I relaod it just fails.Not sure what I am doing wrong here.Any help is appreciated.Thank you.
Try first load the table and then load with group by see script
tmpKeyDate:
LOAD
Id,
[KeyDate]
FROM
Noconcatenate
KeyMaxDate:
Load
Id,
max([KeyDate]) as KeyDate
Resident tmpKeyDate
group by Id;
Drop Table tmpKeyDate;
Sol1://///// RESIDENT LOAD
TempKeyDate:
LOAD
Id,
KeyDate
FROM
KeyDate:
NOCONCATENATE
LOAD
Id,
max([KeyDate]) as KeyDate
RESIDENT TempKeyDate
group by Id;
----------------------------------------------------------------------------------------------
Sol 2://///// Preceding LOAD
KeyDate:
LOAD
Id,
max([KeyDate]) as KeyDate
group by Id;
LOAD
Id,
KeyDate
FROM
What is the error you are getting?
Try like below?
KeyDate:
LOAD
Id,
max([KeyDate]) as Key_Date
FROM
group by Id;
OR
KeyDate:
LOAD id, Max(KeyDate) AS Key_Date
Group By id;
LOAD
Id,
[KeyDate]
FROM
Is this script reading the data?
KeyDate:
LOAD
Id,
KeyDate
FROM
If so, Try this?
KeyDate:
LOAD
Id,
KeyDate
FROM
Final:
NoConcatenate
Load Id, Max(KeyDate) as KeyDate
Resident KeyDate
Group By Id;
Drop Table KeyDate;
Another way to solve it better way is create the QVDs and use this
tmpKeyDate:
LOAD
Id,
[KeyDate]
FROM
Store tmpKeyDate into tmpKeyDate.qvd(qvd);
Drop Table tmpKeyDate;
KeyMaxDate:
Load
Id,
max([KeyDate]) as KeyDate
From tmpKeyDate.qvd(qvd)
group by Id;
What is the error message you get when it fails?