Rapu Ture - Exploring the Rules

was present in New Zealand this many days in the last (rolling) year

Int DAY Person Formula Included used 2 times

Value type Int . Default value 0 Entity person

How is this calculated?

To calculate this variable, the following input is used

Where is this used?

This variable is referred to by these other variables in their own calculations


This is the formula used to calculate the value of days_present_in_new_zealand_in_preceeding_year


This formula is used for scenarios from the date 0001-01-01 onwards. More info on formulas

def formula(persons, period, parameters):

    sum = 0

    start_date = days_since_n_years_ago(period.date)
    for p in [period.offset(offset) for offset in range((start_date * -1), 0)]:
        sum += (persons('was_present_in_nz_and_entitled_to_indefinite_stay', p) * 1)

    return sum

Scenarios calculating this variables