Assigning number of occurrence to variable

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Justices

Assigning number of occurrence to variable

Post 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
vipul315singhal
Posts: 25
Joined: March 28th, 2013, 9:17 am

Re: Assigning number of occurrence to variable

Post by vipul315singhal »

Hi Justices,

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

Regards
Vipul
justice

Re: Assigning number of occurrence to variable

Post 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
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Assigning number of occurrence to variable

Post 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.
Post Reply