Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i want to create a new column in my customer table, where i want to estimate a the column values based on the following rule:
the new field shall show the activity level of the previous period as shown in the table. do you know if it is possible to get the new column in the same customer table?
| Customer | Active | Period ID (timestamp) | New Field (Active previous period) |
|---|---|---|---|
| 00001 | Yes | 149 | - |
| 00001 | Yes | 150 | Yes |
| 00001 | No | 151 | Yes |
| 00001 | No | 152 | No |
| 00001 | Yes | 153 | No |
Yes, use "Above" function
hope it helps
Hi,
Try this.
ABC:
Load * from ABC;
Load Customer,Active,Period_ID,previous(Active) as Previous_Active
Resident ABC order by Period_ID Asc;
Drop table ABC;
Regards,
Kaushik Solanki
thanks for your response
need to order by customer ID and Period ID, i tried this before, not expected result
Did you check for changes in Customer value? Otherwise, first time a new Customer is loaded it would check whether the previous one was active. It should default to null in that situation.