Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need help in getting the next row value in my newly created column called "Next row" as seen below.
How can i be able to get the next value of the same ID
ID | Date | TYPE | Next Row |
45014927561 | 12/27/2023 | 103 | 104 |
45014927561 | 12/27/2023 | 104 | 103 |
45014927561 | 1/8/2024 | 103 | 105 |
45014927561 | 1/8/2024 | 105 | 106 |
45014927561 | 1/8/2024 | 106 | 103 |
45014927561 | 1/8/2024 | 103 | |
4501492800 | 1/9/2024 | 103 | |
4501492808 | 1/10/2024 | 101 | 102 |
4501492808 | 2/11/2024 | 102 | |
4551492756 | 12/22/2024 | 101 | |
4000000000 | 10/29/2024 | 103 | 105 |
4000000000 | 10/29/2024 | 105 | |
4000000001 | 10/29/2024 | 103 | |
4112000000 | 10/24/2024 | 103 | 105 |
4112000000 | 10/24/2024 | 105 | 106 |
4112000000 | 10/24/2024 | 106 | |
Probably easiest with two passes. The first with reverse order to get the value, and mark the second row (where we have the value) as not-for-load. Then a second pass in the original order to peek at the "previous" value and mark the matching row.
Assuming this is in the data load, the typical approach for this is reversing the sort order and getting the previous row.
If it's on the front end, you may be able to use Below() or After() as appropriate.
Thank you for your suggestion.
Now lets say i want to know if Type 101 is immediately followed by type 102, if yes the 2 rows should be excluded from loading.
ID | Date | TYPE | Status |
45014927561 | 12/27/2023 | 103 | Don't Load |
45014927561 | 12/27/2023 | 104 | Don't Load |
45014927561 | 1/8/2024 | 103 | Don't Load |
45014927561 | 1/8/2024 | 105 | Load |
45014927561 | 1/8/2024 | 106 | Don't Load |
45014927561 | 1/8/2024 | 103 | Load |
4501492800 | 1/9/2024 | 103 | Load |
4501492808 | 1/10/2024 | 101 | Don't Load |
4501492808 | 2/11/2024 | 102 | Don't Load |
4551492756 | 12/22/2024 | 101 | Load |
4000000000 | 10/29/2024 | 103 | Don't Load |
4000000000 | 10/29/2024 | 105 | Load |
4000000001 | 10/29/2024 | 103 | Load |
4112000000 | 10/24/2024 | 103 | Don't Load |
4112000000 | 10/24/2024 | 105 | Don't Load |
4112000000 | 10/24/2024 | 106 | Don't Load |
Probably easiest with two passes. The first with reverse order to get the value, and mark the second row (where we have the value) as not-for-load. Then a second pass in the original order to peek at the "previous" value and mark the matching row.
Oooh, So i will do self join?
or save first before redoing it?
I tried something like this but didn't get it
Pass1:
Load stuff From Yourtable;
FinalTable:
Noconcatenate Load stuff Resident Pass1;
Drop Table Pass1;
Thank you so much, you have been so helpful