Data-flo Docs
  • About Data-flo
    • Data-flo Major Update in April 2024
      • Migrating your workflows into the latest version of Data-flo
        • Streamlined adaptors
        • Deprecated adaptors
        • New and retained adaptors
    • Change Log
    • Privacy and Terms of Service
    • Open source software used by Data-flo
  • Data-flo Basics
    • Account
    • Navigation
    • Terminology
    • Interface Icons
    • Data-flo's building blocks: Adaptors
      • Using adaptors to import data
      • Using adaptors to process data
      • Using adaptors to export data
    • Combining adaptors to create workflows
      • Creating a workflow
        • Building a workflow from scratch
        • Cloning an existing workflow
        • Importing a .dataflo file
      • Testing your workflows
      • Running your workflows
      • Accessing your workflows
  • Adaptor reference guide
    • add-column
    • add-jittering
    • add-value-to-dictionary
    • aggregate-rows
    • append-datatables
    • append-lists
    • append-to-list
    • apply-force-directed-layout
    • calculate-column
    • calculate-time-difference
    • change-column-case
    • compare-columns
    • concatenate-columns
    • concatenate-text
    • convert-date-to-text
    • convert-list-to-datatable
    • convert-text-to-datatable
    • convert-text-to-list
    • create-dictionary-from-datatable
    • create-google-drive-folder
    • create-graph-from-datatable
    • create-graph-from-dot
    • create-list-from-datatable
    • create-text-from-template
    • duplicate-column
    • export-file-to-google-drive
    • export-file-to-smb-share
    • export-graph-to-dot-file
    • export-text-to-file
    • export-to-csv-file
    • export-to-dbf-file
    • export-to-google-sheet
    • export-to-microreact-project
    • export-to-sqlite-file
    • filter-list
    • filter-rows
    • find-value-in-dictionary
    • find-value-in-list
    • format-date-column
    • format-time-column
    • geocoding
    • import-file-from-dropbox
    • import-file-from-figshare
    • import-file-from-google-drive
    • import-file-from-http-request
    • import-file-from-s3
    • import-file-from-smb-share
    • import-file-from-url
    • import-from-csv-file
    • import-from-dbf-file
    • import-from-epicollect-project
    • import-from-excel-file
    • import-from-google-sheet
    • import-from-json-file
    • import-from-microreact-project
    • import-from-mysql
    • import-from-oracle
    • import-from-postgres
    • import-from-spreadsheet-file
    • import-from-sql-server
    • import-from-sqlite
    • import-list-from-text-file
    • import-text-from-file
    • join-datatables
    • list-datatable-columns
    • list-newick-leaf-labels
    • map-column-values
    • prepend-to-list
    • query-datatable
    • remove-columns
    • remove-duplicate-list-values
    • remove-duplicate-rows
    • rename-columns
    • rename-newick-leaf-labels
    • replace-blank-values
    • replace-values-in-columns
    • replace-values-in-list
    • replace-values-in-text
    • reshape-long-to-wide
    • reshape-wide-to-long
    • reverse-geocoding
    • run-openai-model
    • run-replicate-model
    • run-workflow
    • sample-datatable
    • select-columns
    • select-list-values
    • select-rows
    • send-email-message
    • sort-datatable
    • sort-list
    • split-column
    • split-geographical-coordinates
    • split-list
    • summarise-datatable
    • transform-columns
    • workflow-repeater
  • Applying Data-flo
    • Basics in Minutes!
      • Quick Workflow
        • Step 1: Configure a solo adapter to view data.
        • Step 2: Add and link a second adaptor.
        • Step 3: Add a value.
        • Step 4: Complete the workflow.
        • Step 5: Run the workflow.
        • Step 6: Share the workflow.
  • API
    • Data-flo API
    • API Access Tokens
  • Support
    • Contact and Feedback
    • Private Installations
Powered by GitBook
On this page
  • Description
  • Inputs
  • Outputs
  • Examples
  • Example 1: Default behaviour.
  • Example 2: Calculate percentage column.
  1. Adaptor reference guide

calculate-column

Description

calculate-column adaptor applies one of the following mathematical operations using values in two columns in a datatable:

  • add: Adds values in left column to values in right column (left + right).

  • subtract: Subtract values in right column from values in left column (left - right).

  • multiply: Multiplies values in left column by values in right column (left * right).

  • divide: Divides values in left column by values in right column (left / right).

  • percent: Calculates the percentage ratio of values in left column out of values in right column (left / right * 100).

  • exponent: Calculates values in left column (raised) to the (power of) of values in right column (left ** right).

Inputs

data Type: datatable Required: Yes The datatable containing the column to be formatted.

left column Type: text Required: Yes The name of the column containing the values on the left-hand side of the operator.

right column Type: text Required: Yes The name of the column containing the values on the right-hand side of the operator.

operation Type: text Required: No The calculate operation to be used. Can be either add, subtract, multiply, divide, percent, or exponent. If unspecified, defaults to add.

result column Type: text Required: No The name of the column to which the calculated values will be added.

result unit Type: text Required: No An optional unit to be appended to the result. If unspecified, defaults to blank.

Outputs

data Type: datatable A datatable with formatted values.

Examples

Example 1: Default behaviour.

Inputs:

data:

Location
January case count
February case count

County X

27

15

County Y

58

80

left column: January case count

right column: February case count

Outputs:

  • data:

Location
January case count
February case count
result

County X

27

15

42

County Y

58

80

138

-> Added the values in January case count column to the values in February case count column. Results were displayed in a new column.

Example 2: Calculate percentage column.

Inputs:

data:

Month
Sales
Total

Jan

1458

14580

Feb

5832

14580

left column: Sales

right column: Total

result column: Percentage

result unit: %

Outputs:

  • data:

    Month
    Sales
    Total
    Percentage

    Jan

    1458

    14580

    10%

    Feb

    5832

    14580

    40%

-> Calculated the percentage ratio of values in Sales column out of values in Total column. The result was added to the Percentage column.

Previousapply-force-directed-layoutNextcalculate-time-difference

Last updated 1 year ago