Page 1 of 1

Assigning number of occurrence to variable

Posted: November 2nd, 2015, 1:42 am
by Justices
Hi Josh or who can help,
I would like to to know the total number of members who are 5yrs and older in a roster (S1Roster) and pass it to variable (s2aSize).
I came up with this

s2aSize = totocc(SEC1000 where s1q4a > 5);

s2aSize = count(SEC1000 where s1q4a > 5);

It did not work, any help pls

Re: Assigning number of occurrence to variable

Posted: November 2nd, 2015, 3:28 am
by vipul315singhal
Hi Justices,

It will be like
s2aSize = count(s1q4a where s1q4a > 5);

Regards
Vipul

Re: Assigning number of occurrence to variable

Posted: November 2nd, 2015, 5:56 am
by justice
Thanks for the response Vipul
Did not solve my issue i want the counted value assigned to (s2aSize)
s1q4a is in a different section as a roster and (s2aSize) in another non roster

Re: Assigning number of occurrence to variable

Posted: November 2nd, 2015, 7:12 am
by josh
You can't use totocc with a where clause so you should use count instead. Count takes the name of the dictionary record rather than the name of the group. Try replacing SEC1000 with the name of the repeating record that contains the variable s1q4a.