Page 1 of 1

Skipping rows in rosters

Posted: July 28th, 2021, 4:51 am
by Jayanta
Hi All,

I have this query of implementing skips on rows of a roster. Kindly help me achieve this scenario.

For instance, I have a roster NAME_OF_THE_HOSPITAL000. It has 5 rows and one of it's column field is SPEC.
The validation for these fields are such:
(1) if SPEC value is 1 for any row, let's say Row1, it skips to next row, that is Row2.
(2) if SPEC value is 2 for Row3 particularly, it skips to next to next row, that is Row5.

My code is as such:

Code: Select all


PROC SPEC

if SPEC = 1 then skip to next;
endif;

if SPEC(3) = 2 then skip to SPEC(5);
endif;

On entering value 1 in Row 5, it works fine and skips to next row.
However, I'm getting error on entering value 2 in Row5, that is: "Unable to skip, target item is the current item"

Image

Re: Skipping rows in rosters

Posted: July 28th, 2021, 7:21 am
by Gregory Martin
The problem is that this code always checks the value of the third SPEC, so even when you're on fifth SPEC, if SPEC(3) is 2, you'll be trying to skip:
if SPEC(3) = 2 then skip to SPEC(5);
endif;
Do this instead:
if curocc() = 3 and SPEC = 2 then skip to SPEC(5);
endif;

Re: Skipping rows in rosters

Posted: July 28th, 2021, 9:13 am
by Jayanta
Thank you Gregory Martin,
This made my task easier. Thanks a ton. 8-) !