what is the equivalent of FUNCTION in tablogic of tabulations?
my code in tablogic:
do numeric i = 1 while i <= totocc(PART_I)
IF count(PART_I where(SEX(i) = 1)) > 0 THEN
MALE= 1;
errmsg("MALE");
ENDIF;
in LST file: there are 3 "MALE"
but in the output table there are only 2 counts of MALE .
Tried running the tabulate freq, total male is 3.
MALE is added item in the Working Storage Dictionary.
How can i correct this?
Thanks
COUNT FUNCTION
Re: COUNT FUNCTION
just observed that MALE item count per Record while the errmsg" MALE" count per Occurence
Re: COUNT FUNCTION
Any suggestions what function to use? Thanks
Re: COUNT FUNCTION
Do you want to count the number of male household members in a given household or just check the existence of a male household member in a household ? ERRMSG ("male") , lists the number of males found in an household i.e 3 males found with in two household .
Re: COUNT FUNCTION
Yes i want to count the total male per household in my tabulation application, but per checking if a househould has a male(example 2 or more male in a household) the tabulation count is per household not per individual. i just added the errmsg(); function to check if the used function is correct.
Any suggestions? i want to count the male per individual but i dont know what function to use in the field of Tablogic.
*Note this is a tabulation application.
Any suggestions? i want to count the male per individual but i dont know what function to use in the field of Tablogic.
*Note this is a tabulation application.
-
- Posts: 1845
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: COUNT FUNCTION
If you go to Table Attributes for your table (Ctrl+B), the second dropdown is for "Unit Tallied." Make sure the unit is the record with the individual on it, not a singly-occurring record (like a household record). The tally unit controls how often your table logic is executed, so changing it should give you the result you desire.
Re: COUNT FUNCTION
I think, you need to modify male =1; to male =male +1 and in your tabulation i.e. when you drag Male into the table, you need to use SUM instead of COUNT
my code in tablogic:
do numeric i = 1 while i <= totocc(PART_I)
IF count(PART_I where(SEX(i) = 1)) > 0 THEN
MALE= MALE + 1; {need to modify this }
errmsg("MALE");
ENDIF;
my code in tablogic:
do numeric i = 1 while i <= totocc(PART_I)
IF count(PART_I where(SEX(i) = 1)) > 0 THEN
MALE= MALE + 1; {need to modify this }
errmsg("MALE");
ENDIF;