Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I want to add a before_ and_ After field to my table, preferbly joined or built in the first table.
Here is the code to create the field, feel free to change it if needed.
Try this,
tab1:
LOAD RowNo() As RowID,*,
If(Peek(Id)<>Id, If(Odd(Id),'Before','After')
) As Before_or_After;
LOAD * INLINE [
Name, Date 1, order date, Id
John, 01/01/2010, 01/01/2010, 1
John, 01/01/2010, 01/01/2010, 1
John, 01/01/2010, 01/01/2010, 1
John, 01/01/2010, 05/01/2010, 2
John, 01/01/2010, 05/01/2010, 2
John, 01/01/2010, 05/01/2010, 2
Paul, 01/01/2010, 01/01/2010, 3
Paul, 01/01/2010, 01/01/2010, 3
Paul, 01/01/2010, 01/01/2010, 3
Paul, 01/01/2010, 05/01/2010, 4
Paul, 01/01/2010, 05/01/2010, 4
Paul, 01/01/2010, 05/01/2010, 4
];
Output:
This was a sample data, hasn't worked with my real data. I'm getting before for each row and nothing for after.