Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have the following table:
nr. type end date start date Value
1 A 10-01-2018 01-01-2018 10
2 A 12-05-2018 01-05-2018 5
3 B 09-09-2018 01-09-2018 6
I need to get only rows with the latest end date. How can I do it within my LOAD statement?
The result shoud be:
nr. type end date start date Value
2 A 12-05-2018 01-05-2018 5
3 B 09-09-2018 01-09-2018 6
Thank you in advance for help!
Having loaded in your initial table,
RIGHT KEEP ([Your Table Name])
LOAD
[nr.],
max([end date]) as [end date]
RESIDENT [Your Table Name]
GROUP BY [nr.]
;
Ok, I guess I need to make more clarification..
I have such table (a part of it), where a date '01.01.1753' means an empty space (in a specific database), this means, the price is open without the end date.
I need for each type get the record with the most actual end date.
This means:
- if the end date is 01.01.1753 then this record,
- otherwise the record with the max(end date)
The result have to be: