Data Auto-fill in Roaster

Discussions about CSEntry
Post Reply
subash
Posts: 26
Joined: March 3rd, 2016, 5:49 am
Location: Nepal

Data Auto-fill in Roaster

Post by subash »

I wanted to know how can we Auto-fill the roaster if we have fill the roaster data at first, than after that auto fill the other roaster same as the previous filled roaster??? Is there any syntax for that or whether it do have such function or not???
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Data Auto-fill in Roaster

Post by Saint »

Hi Subash,
Yes, you can autofill a field with the content of another field. By extension, you can autofill a roster with the corresponding variables from another roster. It has to be done with individual field by field matching. If you can give more details of what exactly your scenario is, it would help in providing you with a more specific solution.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Data Auto-fill in Roaster

Post by josh »

You can auto-fill a roster the same way you auto-fill a regular field in CSPro in logic. The main difference is that with a roster you need to use a subscript to indicate the row number. For example SEX[1] = 2 will set the value of SEX in row 1 of the roster to 2.
subash
Posts: 26
Joined: March 3rd, 2016, 5:49 am
Location: Nepal

Re: Data Auto-fill in Roaster

Post by subash »

PROC Q401C_2

preproc
$=Q401C_1;

If $=missing then
skip to Q401A_3;
endif;

I have used the above logic for the same program but the problem is it only auto fill the last number of the roaster. It do not fill all the different number correspond to the previous one. If I have to mention each column section code then how can i do that. Could you please suggest me.

What ever number is entered in the roaster Q401C_1, those number should be auto filled in each roaster of Q401C_2, Q401C_3 and so on. Just regarding roaster I wanted to know whether this function work or not.
Attachments
ROASTER AUTOFILL.png
ROASTER AUTOFILL.png (26.28 KiB) Viewed 8643 times
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Data Auto-fill in Roaster

Post by Saint »

Hi Subash,
As Josh indicated, you have to use the row subscripts in the logic. So your logic should look something like this:

Code: Select all

PROC Q401C_2
preproc
for i in newroster do
   Q401C_2(i) =Q401C_1(i);
enddo;

I guess this second part is supposed to be a post proc.  
If $=missing then
  skip to Q401A_3;
endif;
For this code to work, i should be declared as numeric, ideally in Global Proc. Hope this helps.
subash
Posts: 26
Joined: March 3rd, 2016, 5:49 am
Location: Nepal

Re: Data Auto-fill in Roaster

Post by subash »

Thank you for that, But I how can i code the sub-script cause i couldn't find it, and next thing i want all the data at once correspond to the previous roaster data, So, is it possible to do that??
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Data Auto-fill in Roaster

Post by Saint »

Hi Subash,
Take a look at the attached. I autofill roster 2 with information entered in roster 1 with the most basic logic. I use the curocc instead of an index to loop. If you truly want the autofill so that the fields in roster 2 may not be changed, then you can consider protecting the fields in roster 2 in which case you will not need the advance commands.

Best.
S...
Attachments
ROSTER AUTOFILL.zip
(4.54 KiB) Downloaded 451 times
subash
Posts: 26
Joined: March 3rd, 2016, 5:49 am
Location: Nepal

Re: Data Auto-fill in Roaster

Post by subash »

Thank you Saint but my concern was whether we can repeat the data or not in normal roaster. Is it possible in roaster to check that the same number is filled or not through the logic check Q209 and Q211?? The roaster formate is attached below.
Attachments
Roaster type
Roaster type
cspro roaster.png (11.44 KiB) Viewed 8509 times
Saint
Posts: 63
Joined: November 22nd, 2013, 4:59 am

Re: Data Auto-fill in Roaster

Post by Saint »

Hi Subash,
Sure you can check. If I understand right, you want to check for example that Q211(1)=Q209(1) and return an error message if not? If that is the case, you can put the following check on the postproc of Q211. Not sure why you have different number of concurrences for Q209 and Q211.

Code: Select all

PROC Q211
if Q211(curocc(***Q211ROSTERNAME***)) <> Q209(curocc(***Q211ROSTERNAME***)) then
  errmsg("message here");
endif;
subash
Posts: 26
Joined: March 3rd, 2016, 5:49 am
Location: Nepal

Re: Data Auto-fill in Roaster

Post by subash »

Thank you Saint for the syntax. Could you send me the zip file for the same procedure??
Post Reply