Kumu
  • Getting started
    • Welcome
    • Kumu 101
    • First steps
    • Quick tips
    • Webinars
  • Overview
    • Kumu's architecture
    • Accounts and workspaces
    • Kumu.io and Kumu Enterprise
    • Billing
    • User interfaces
      • Dashboard
      • Settings
      • Map editor
      • View editors
      • Quick Actions
    • Collaborating and sharing
    • Actions and permissions
    • Security
    • Advanced Editor hub
      • @settings reference
      • @controls reference
      • Color reference
      • Property reference
      • Selector reference
  • DISCIPLINES
    • SNA / Network Mapping
    • Systems mapping
    • Systems Practice workbook
  • Guides
    • Activity feed
    • Add-ons
      • Disqus
    • Bridge
    • Cluster
    • Controls
      • Cluster control
      • Color-legend control
      • Filter control
      • Focus control
      • Image control
      • Label control
      • Showcase control
      • SNA-dashboard control
      • Tagged-timeline control
      • Text Control
      • Title Control
      • View toggle control
    • Decorations
      • Direct decorations
      • Data-driven decorations
      • Flags
      • Icons
      • Images
      • Label templates
      • Popovers
    • Default view settings
    • Export
    • Fields
      • Computed fields
    • Filter
    • Focus
    • Forking
    • Grids & Guides
    • Import
      • Structure your data for Kumu
      • Excel / CSV
      • Google Sheets
      • JSON / Blueprints
    • Imported views
    • Layouts
      • Fixed
      • Force-directed
      • Remove overlap
      • Scatter
      • Snap-to
    • Legends
    • Licensing
    • Lightbox
    • Loops
    • Metrics
    • Two-factor authentication
    • Pro workspaces
      • Archiving projects
      • Discussions
    • Partial views
    • Presentations
    • Profiles
      • Markdown
    • Project admin
    • Selectors
    • Shapes
    • Share and embed maps
    • Shortcuts
    • Showcase
    • Slugs
    • Table
    • Templates
      • Geo template
    • URLs
    • Views
    • Widgets
  • About Kumu
    • What is Kumu?
    • How does it work?
    • Where can I get help?
  • Enterprise
    • About enterprise
    • Getting started with VMWare
    • Upgrading
    • Configuration
    • Creating user accounts
    • SSH Access
    • Single sign-on
    • Backing up enterprise data
    • Restoring enterprise data
    • Command line utilities
    • Changelog
  • Frequently Asked Questions
    • Does Kumu have a public API?
    • Does Kumu make use of AI?
    • How do I add annotations?
    • How do I add anchors to my map description?
    • How do I add arrows to my connections?
    • How do I add documents to profiles?
    • How do I add more than one element with the same label?
    • How do I add text dropdowns to my map overview?
    • How do I adjust arrow size?
    • How do I avoid duplicating data?
    • How do I change connection curvature?
    • How do I change font color?
    • How do I change font size?
    • How do I change the default for currency fields?
    • How do I change the length or strength of connections?
    • How do I change the order of control options?
    • How do I change the position of my element labels?
    • How do I cite Kumu?
    • How do I collapse duplicate connections?
    • How do I copy a map to another project?
    • How do I control label size while scaling element size?
    • How do I control text wrapping?
    • How do I convert a project from private to public?
    • How do I convert a project from public to private?
    • How do I create dynamic on/off toggles for my map?
    • How do I customize link text in popovers?
    • How do I customize the order of my legend?
    • How do I delete a project, map, or view?
    • How do I delete data from my project?
    • How do I downgrade my subscription?
    • How do I edit virtual elements?
    • How do I get rid of duplicates?
    • How do I hide elements without connections?
    • How do I hide images from the map but keep them in the profile?
    • How do I hide labels on my map?
    • How do I hide the settings button?
    • How do I keep elements from moving?
    • How do I list an element's connections in its profile?
    • How do I make elements transparent?
    • How do I make sense of my receipt?
    • How do I open a sub-system when clicking on an element?
    • How do I remove the Opposite entry from my legend?
    • How do I remove unneeded controls?
    • How do I remove unwanted legend entries?
    • How do I rename my map/view?
    • How do I restructure my adjacency matrix?
    • How do I select options by default in my control?
    • How do I set a minimum or maximum zoom level for my map?
    • How do I show the Settings button?
    • How do I size elements based on number of connections?
    • How do I transfer a project?
    • How do I update my credit card information?
    • How much data can my Kumu project handle?
    • How do my readers switch between maps and views?
    • My data won't import. What can I do?
    • My Kumu embed is not working. What can I do?
    • My map disappeared. How do I bring it back?
    • My PDF won't export. What can I do?
    • What pricing plans does Kumu have?
    • Where can I find my invoices?
    • Where can I find example Kumu projects?
Powered by GitBook
On this page
  • Creating a computed field
  • Supported syntax
  • Things to watch out for
  • Dividing by 0
  • Order of operations matters
  • Avoid null values
  • Advanced usage
  • Limitations

Was this helpful?

Edit on GitHub
  1. Guides
  2. Fields

Computed fields

Computed fields are a special type of field that allow you to calculate values automatically based on an expression that you specify.

Creating a computed field

You can create a computed field in one of two ways:

  1. Type = expression into any field value and it will convert that field to a computed field using the specified expression.

  2. Click on the label of any field from the profile and then use the dropdown menu to access the settings. Under "Advanced Settings" you'll see an "expression" input where you can type the expression (no = required).

Supported syntax

Concatenating text in computed fields

To create a new string (a piece of text) using computed fields, just type your expression inside a pair of double quotes. Include a value from another field using double curly brackets {{}} with the field name inside, in all lowercase letters.

For example, here's the expression for computed field that combines the elements label and type in a simple sentence.

// Note the double quotes surrounding the expression,
// and the double curly brackets around each field name.
= "{{label}} is a {{type}}"

You can also bring numbers into your expression:

= "Dr. Evil is demanding ${{ridiculous amount of money}}"

Doing math in computed fields

If the field you are using in your expression is a single word, you can just write it as-is in the expression. If it is more than one word, you'll need to wrap the field name with two mustaches on either end {{my longer than neccessary field name}} . For all field names, be sure that they are written in all lowercase letters.

Here's some examples:

  • Add two values betweenness + eigenvector

  • Multiply two values {{level of influence}} * degree

  • Create a more complicated ratio (indegree + outdegree)/betweenness

  • Check for a value and output a number (archetype == "yes" ? 1 : 0)

  • Take the log of a value log(networth)

Things to watch out for

When you are building expressions, you need to be careful not to build an expression that may lead to an undefined value or an error. Here's a few common stumbling blocks:

Dividing by 0

For those of you whose last math class was decades go - remember you can't divide by 0 (or you can, but we'll display the answer as "infinity").

One way you may run into this is when creating an equation for leverage. Leverage is usually defined as "outdegree/indegree". If you have an element with no incoming connections, you're going to get "infinity" as the answer which will throw off your decorations.

Instead, try tweaking the expression so that it is:

(outdegree + 1)/(indegree + 1)

Order of operations matters

Order of operations applies to expressions so make sure to wrap the portions of your expression that you want to be calculated first in parentheses. For example...

indegree + outdegree / betweenness

will get a different result from

(indegree + outdegree) / betweenness

Avoid null values

If you have a field without a value defined, it can cause errors when running the expression. Make sure each element has at least some value and if you are using yes/no types of fields, make sure to include "no" instead of just leaving it blank.

Advanced usage

Some of you are interested in creating an uber analysis metric based on whether there are qualitative and or quantitative values in other fields. You can create conditional statements that provide different values based on whether the criteria is met.

The below example involves two fields, "archetype" and "trend" that each store "yes" or "no" values. We're essentially looking to give a point anytime the answer is "yes" and then add up those points. Here's the expression:

(archetype == "yes" ? 1 : 0)+(trend == "yes" ? 1 : 0)

Make sure that you're including "no" for the fields that aren't "yes" instead of just leaving them blank as it will throw an error that will prevent the expression from running.

Limitations

Currently you can only create a computed field that pulls values from other standard fields in Kumu. You cannot create a computed field which pulls values from other computed fields.

For example, if you created a computed field "total contributions" which was based on the expression {{amount for}} + {{amount against}}, you couldn't use "total contributions" in another computed field that was looking at the relative percentage of for vs. against.

This wouldn't work:

{{amount for}} - {{amount against}} / {{total contributions}}

But just including the expression again for "total contributions" would work:

{{amount for}} - {{amount against}} / ({{amount for}} + {{amount against}})
PreviousFieldsNextFilter

Last updated 6 months ago

Was this helpful?

We use to power computed fields and you have their complete expression syntax to use within Kumu. It's pretty similar to writing an equation in Excel or Google Sheets (with the caveat that we don't support all the functions you'd find in a spreadsheet, like vlookup).

That's just the tip of the iceberg. Head over to if you're interested in what else is possible.

mathjs
mathjs