Skip case in occurence when equal to 0

Discussions about CSEntry
Post Reply
fredlouvain

Skip case in occurence when equal to 0

Post by fredlouvain »

Hi,

Since some hours i'm facing a problem. I would like to create a small code that at each time one of the case in the occurence is equal to 0, it switch to next occurence in order to speed up the data entry process. 0 is given by an occurence formerly in my dataset but all the time that i try the function advance or move to it's written that it is placed backward in the process.

What can i do ?

Frédéric
pierrew
Posts: 47
Joined: August 8th, 2012, 5:20 am
Location: Pohnpei, Federated States of Micronesia

Re: Skip case in occurence when equal to 0

Post by pierrew »

Hello Federic ,

I am guessing that you have a multiple occurring record that has an Item that has several occurrences. So it might look like this ...

LABEL NAME OCC
RECORD 1 REC1 10
.... items in REC1
LABEL NAME ITEMTYPE ... OCC
ITEM1 IT1 ITEM ... 4
SUB1 SB1 SUBITEM ... 1
SUB2 SB2 SUBITEM ... 1

So there are two ways to approach this ...
1) you can use the "count" function
i = count(IT1 where SB1 = 1);
if i = 0 then
skip to next;
endif;

2) if totocc(IT1) = 0 then
skip to next;
endif;

You have to check the name of the roster in the form and that will be the name of the group "IT1". One more thing you should put this in the postproc of the previous item before entering the next multiple occurring record. It's a bit hard to visualize the structure of your entry screen because, if you are entering data then all items after the current item will always be zero because you have not entered the data. In any case, if the multiple occurring record is has already been entered then all you need is to use the correct group or record name in the totocc() or count() functions.

Sorry this suggestion is based on the information that you provided and could be a lot more complicated based on the structure of your dictionary.

I hope this helps or maybe someone else has a better approach.

Cheers,
Pierre
Post Reply