Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI
I have this table without the To field in null.
ItemId | Rate_Id | Rate | From | To |
10362678 | 10362678-42370 | 2,99 | 01/01/2016 | |
10362678 | 10362678-42415 | 3,08 | 15/02/2016 | |
10362678 | 10362678-42416 | 3,08 | 16/02/2016 | |
10356767 | 10356767-42370 | 6,82 | 01/01/2016 | |
10356767 | 10356767-42395 | 6,32 | 26/01/2016 |
I want to close the lines where there is a new one and if there is no new, T0= Today()
Many thank's
Eduard
Try this:
Table:
LOAD * INLINE [
ItemId, Rate_Id, Rate, From
10362678, 10362678-42370, 2.99, 01/01/2016,
10362678, 10362678-42415, 3.08, 15/02/2016,
10362678, 10362678-42416, 3.08, 16/02/2016,
10356767, 10356767-42370, 6.82, 01/01/2016,
10356767, 10356767-42395, 6.32, 26/01/2016
];
FinalTable:
LOAD *,
Date(If(ItemId = Previous(ItemId), Previous(From), Today())) as To
Resident Table
Order By ItemId, From desc;
DROP Table Table;
Try this:
Table:
LOAD * INLINE [
ItemId, Rate_Id, Rate, From
10362678, 10362678-42370, 2.99, 01/01/2016,
10362678, 10362678-42415, 3.08, 15/02/2016,
10362678, 10362678-42416, 3.08, 16/02/2016,
10356767, 10356767-42370, 6.82, 01/01/2016,
10356767, 10356767-42395, 6.32, 26/01/2016
];
FinalTable:
LOAD *,
Date(If(ItemId = Previous(ItemId), Previous(From), Today())) as To
Resident Table
Order By ItemId, From desc;
DROP Table Table;
Your aree sooooooo big
Why am I so big my friend