Page 1 of 1

function

Posted: Sun May 21, 2006 5:28 pm
by sainath
hi
i have a bussiness conditon that if a row contains PRE then compare with below one and if it contains POST compare with above row.
i am using rowcompare to compare with previous value .
my question is how to compare with next row.
do we have any rowcomparenext ---.
pl share your thoughts.
thks

Posted: Sun May 21, 2006 8:34 pm
by ray.wurlod
How do you expect to compare with the next row when you haven't even read the next row yet???

The best you can do is to store the previous row's value and compare when POST comes through. You need your data sorted for this to work properly, of course.

Posted: Sun May 21, 2006 11:00 pm
by kumar_s
Or you can have one extra stage variable set to store CURRENT, IMMEDIATE PREVIOUS, PREVIOUS TO IMMEDIATE PREVIOUS.
So that if it is PRE you can use IMMEDIATE PREVIOUS and PREVIOUS TO IMMEDIATE PREVIOUS.
If is is POST you can use CURRENT and IMMEDIATE PREVIOUS.

Posted: Tue May 23, 2006 6:49 pm
by sainath
hi
thanks for your reply.still i am not able to find the solution for this problem.if i got PRE RECORD i should compare with next row not the
immediate previous record. can you please share your thoughts
to solve this problem
thks


<i have a bussiness conditon that if a row contains PRE then compare with below one and if it contains POST compare with above row.
i am using rowcompare to compare with previous value .
my question is how to compare with next row.
do we have any rowcomparenext ---.
pl share your thoughts. >
thks

Posted: Tue May 23, 2006 8:33 pm
by ray.wurlod
You have not yet read the next record.

Therefore you can not compare anything to it.

What you ask is impossible.

Is that sufficiently definitive?

Posted: Wed May 24, 2006 7:27 am
by DSguru2B
Ray, i remember you once mentioning that the Harry Potter stage can do stuff like this. Right ? :lol:

Posted: Wed May 24, 2006 7:38 am
by kumar_s
Ray has already mentiond in his post that it not possible to compare a record even before it was read or accessed.
You can compare yesterday and today and not today and tomorrow.
If you have read 0,1,2 and if you need to compare current and previous and current and need to compare 1 and 2 similarly 2 and 3. where you havent read 3 so far.
Hence Move your reference level to one level up.
For first case read compare 0 and 1. And for second case compare 1 and 2.