Home
Welcome:
Quick Links
Introduction
Programming
Syntax
Examples
Slate Card Generator
Van Export Filter

Analyzer File Analysis Utility Documentation

Voter Analysis Program Syntax

General Syntax

The general structure of a statement is:
<statement> <optional name> ( <operation> )

Where:

<statement> is a valid statement name.
<label> is a user supplied identifier.
<operation> is either a comma separated list, a condition or a calculation

Fields, Values and Precinct Numbers

Fields and Values share the same syntax rules - they are both examples of simple strings. The difference is in usage only. Field names and values may be enclosed in quotation marks (either single or double). Quotation is only required when a field name or value contains spaces.

Precincts are special case fields. Precincts in SOE datasets are identified at the sub-precinct level. The Voter Analysys program regognizes the difference between whole and sub-precincts.

Precinct and Zone statements define lists of precincts to use for establishing rows of data in the report. If the precincts are defined using whole precinct numbers, then the rows in the report will represent the aggregate of all sub-precinct numbers. If the precincts are defined using sub-precinct numbers, then the report rows will reflect the sub-precincts.

In conditional statements, whole precinct numbers will match all corresponding sub-precincts.

Statement Syntax

  • Groupby: ( <columns> )

    Where <columns> is a comma separated list of column names. the list may contain one to three entries. Examples:

  • GroupBy: ( Party )
  • GroupBy: ( "Precinct Number" )
  • GroupBy: ( Precinct, Party, Race )
  • Precinct: ( <number> [ , <number>])

    Examples:

  • Precinct: ( 001, 002, 003 )
  • Precinct: ( 64.1, 64.2, 64.3 )
  • Zone: <value>

    Where <value> is the name of a pre-defined zone. See Language Syntax. for a list of valid zone names.
    Examples:

  • Zone: AllPrecincts
  • Zone: Zone76N
  • Filter: [ "Include" | "Exclude"] ( <criteria> )
  • Where
    <criteria> is [ ( <condition> [ <boolean_operator> <condition>] ) ]
    <boolean_operator> is [ AND | OR ]
    <condition> is [ ( <field> <logical_operator> <value> ) ]
    <logical_operator> is one of ( <, <=, ==, >=, > )

    Examples:

  • Filter: Include ( "Party" == "DEM" )
  • Filter: Exclude ( ('2020GeneralElection' == 'N' ) OR
        ('2020GeneralElection' == '' ) )
  • Filter: Include ( ( 'House_District' == 77 ) and ( 'Voter Status' == 'ACT' ) )
  • Report: <Report Name>

    Example:

  • Report: "Precinct77ActiveVoterCounts"
  • Column: <Column Name> ( <criteria> )

    Where
    <criteria> is [ ( <condition> [ <boolean_operator> <condition>] ) ]
    <boolean_operator> is [ AND | OR ]
    <condition> is [ ( <field> <logical_operator> <value> ) ]
    <logical_operator> is one of ( <, <=, ==, >=, > )

    Examples:

  • Column: "TTL Dems" ( "Party" == "DEM" )
  • Column: "Dems Not Voting" ( Party == 'DEM' ) AND
    ( ('2020GeneralElection' == 'N' ) OR
        ('2020GeneralElection' == ' ' ) )
  • Compute: <Column Name> ( <calculation> )

    Where
    <calculation> is [ ( <column-name> <math_operator> <column-name> ) ]
    <math_operator> is one of ( +, -, *, /, %)

    The standard operators (add, subtract, multiply, divide) perform the operations you would expect. The % operator can be used to compute a percentage ( (A*100)/B).
    Examples:

  • Compute: '% DEM Voted' ( 'Dems Votes' % 'TTL Dems')
  • Compute: 'Diff' ( 'REP Voted' - 'DEM Voted')