Hi,
Please how will I solve such a scenario?
I have a column A:
23434
45235
AB234
13443
12444
AB324
13443
AB324
12334
I want such an output
23434 1
45235 2
AB234 3
13443 3
AB324 4
13443 4
AB324 5
12334 5
Basically if column A[1,2]="AB" the number remains the same. I defined sth like this in stage var:
If Prev <> "AB" AND yyy.A[1,2] = "AB" Then xxx Else xxx +1 xxx(stage var 1)
yyy.A Prev(stage var 2)
This gives an output like this:
23434 1
45235 2
AB234 2
13443 3
AB324 3
13443 4
AB324 4
12334 5
Rgds,
K
Compare row then increase
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 17
- Joined: Mon Jan 16, 2006 2:11 pm
- Contact:
Compare row then increase
ARSENAL GUNNERS GOONER
-
- Participant
- Posts: 17
- Joined: Mon Jan 16, 2006 2:11 pm
- Contact:
Re: Compare row then increase
kayarsenal wrote:Hi,
Please how will I solve such a scenario?
I have a column A:
23434
45235
AB234
13443
12444
AB324
13443
AB324
12334
I want such an output
23434 1
45235 2
AB234 3
13443 3
AB324 4
13443 4
AB324 5
12334 5
Basically if column A[1,2]="AB" the number remains the same. I defined sth like this in stage var:
If Prev <> "AB" AND yyy.A[1,2] = "AB" Then xxx Else xxx +1 xxx(stage var 1)
yyy.A Prev(stage var 2)
This gives an output like this:
23434 1
45235 2
AB234 2
13443 3
AB324 3
13443 4
AB324 4
12334 5
Rgds,
K
U can use 2 sort stages , the first one will sort , the second one will produce a KeyChange . Then have a transformer , that looks for the key change field . Keep incrementing till then .it should work