Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

This is an advanced feature that can break your reports.
If you need a hand to get this set up, please get in touch with us at support@tatou.app.

When building a Custom Report, you set the required columns, and the type of data each column contains. One data type is Custom Logic which allows more complex conditional values.

Custom Logic takes one or more conditional statements to determine which value to populate each cell with. This logic is executed for each row when populating this column.

Syntax

The syntax is specific to Tātou, so may vary from other syntax you are familiar with.

Each rule is on its own line, and each component is separated by a space.

IF {CONDITION} THEN {RESULT}
ELSE {OTHER_RESULT}

Rules can have multiple conditions strung together

IF {CONDITION} AND {CONDITION} THEN {RESULT}
ELSE {OTHER_RESULT}

Accepted elements

  • IF a rule exists on this line

  • ELSE if no rules above match, use this result

  • $value_type value type name

  • == equals

  • != does not equal

  • AND links multiple conditions

  • THEN result follows

  • + concatenate with another value type or text

Value types

These variables are available in both your condition, and in your output. Prefix these variables with a $ so they are recognised as a variable rather than plain text.

  • Standard fields

    • date

    • finish_time

    • from_date

    • hourly_rate

    • hourly_rate_adjusted

    • hours

    • job_notes

    • rate_autoselect

    • rate_type

    • rate_type_text

    • role

    • start_time

    • start_time__finish_time

    • to_date

    • total

    • unit_rate

    • units

    • units_autoselect

    • unpaid_break

    • row_split

    • unpaid_break_start_times

    • unpaid_break_end_times

    • multiplier

  • Association fields

    • client__code

    • client__costing_code

    • client_name__location_name__block_name

    • location__costing_code

    • location_name__block_name__task_name

    • block__costing_code

    • block_name__task_name

    • costing_code

    • costing_code__task_code

    • task_category__code

    • task_category__name

    • task_code__code

    • task_code__name

    • employee__email

    • employee__full_name

    • employee__recruitment_type

    • employee__staff_id

    • employee__division

    • employee__subdivision

    • employee__groups

  • Costs

    • base_cost

    • topups_cost

    • pdrst_cost

    • pay_performance_bonus_cost

    • foreign_cost

    • additional_cost

    • overtime_cost

    • total_cost

  • Other fields

    • custom_logic

    • row_name

    • row_type

Row types

Each row has two further variables that are useful when creating logic based on the type of row we’re working with.

  • row_type will be one of:

    • summary

    • timesheet_entry

  • row_name can be one of:

    • paid_rest_break

    • topup

    • contract_hours

    • total_hours

    • ordinary_hours

    • overtime_hours

      • If multiple overtime rates, then these will be in the format overtime_hours_RATE, for example overtime_hours_2.0

    • days_worked

    • pay_contract_summary 

    • agreed_hours_topup

Examples

Example 1

IF $row_type == summary THEN $hours
  • If the row is a summary row, then return the row’s $hours

  • Result: “1.25”

Example 2

IF $unit_rate == 1.5 THEN piece rate+_+$unit_rate
  • If the row’s unit rate is 1.5, then concatenate text with “unit rate”

  • Example result: “piece rate_1.5”

Example 3

IF $row_name == topup THEN $total
IF $row_name == paid_rest_break THEN $hours
IF $row_type == timesheet_entry AND $rate_type == contract THEN $unit_rate
ELSE $hourly_rate
  1. If the row is the top-up summary row, then return the total value ($total); otherwise

  2. If the row is the paid breaks summary row, then return the number of hours ($hours); otherwise

  3. If the row is a contract timesheet entry, then return the unit rate ($unit_rate); otherwise

  4. Return the hourly rate ($hourly_rate)

  • No labels