RUNDEF OvercrowdingRatio
   SELECTION %SELECTION
   %UNIVERSE
   
*  %SELECTION Selection File
*  %UNIVERSE Universe Condition
*  %FILTER Filter Condition
*  %1 Individual Entity
*  %4 Household Entity
*  %5 Entity Output
*  %9 Target count

DEFINE %4.NPERS OVERRIDE
  AS COUNT %1
  %FILTER
  TYPE INTEGER
  
DEFINE %4.CONDITION
  AS %4.NPERS > %9 
  TYPE INTEGER
  OPTIONS DEFAULT 0
  RANGE 0-1

DEFINE %5.CNTNUM
  AS COUNT %4
  FOR %4.CONDITION = 1
  TYPE INTEGER
  VARLABEL "Cases"

DEFINE %5.CNTDENUM
  AS COUNT %4
  %FILTER
  TYPE INTEGER
  VARLABEL "Total"
  
DEFINE %5.RATIO
  AS 100 * ( %5.CNTNUM / %5.CNTDENUM )
  FOR %5.CNTDENUM > 0
  TYPE REAL
  VARLABEL "Overcrowding %"
  
TABLE List
  AS AREALIST
  OF %5,
     //%5.DIST,
     //%5.LABEL
              %5.CNTNUM,
                %5.CNTDENUM,
                %5.RATIO 7.2
//  OPTION OMITTITLE
