Need help to resolve a logic.
Moderators: chulett, rschirm, roy
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I cannot discern any generalizable logic that would produce the desired output. Can you please provide a written rule (or set of rules)? In particular I don't understand how the final two rows in your example, especially the penultimate one, are obtained.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
So the logic is:
(a) If the first column is NULL, then use the value from the previous row's first column instead of the NULL.
(b) If the second column is NULL; then use the value from the current row's first column instead of the NULL.
If that is correct, then use 2 stage variables as follows:
Derive NewColumn from svNewColumnValue and OldColumn from svOldColumnValue.
(a) If the first column is NULL, then use the value from the previous row's first column instead of the NULL.
(b) If the second column is NULL; then use the value from the current row's first column instead of the NULL.
If that is correct, then use 2 stage variables as follows:
Code: Select all
svNewColumnValue IF IsNull(In.NewColumn) THEN svLastNewColumnValue ELSE In.NewColumn
svLastNewColumnValue In.NewColumn
svOldColumnValue IF IsNull(In.OldColumn THEN svNewColumnValue ELSE In.OldColumn
</a>