Compute a date dimension

Learn here how to compute dates on your cards, using date & time arithmetic

  1. What is a Compute a date dimension ?
    1. Example
  2. The expression language
    1. How to find the dimension codes ?
  3. Where to get help ?
  4. Going further

What is a Compute a date dimension ?

This kind of dimension enriches your card with data, like any other dimension. But the value on a card is not chosen manually in the card edition dialog, but is the result of a computation involving values provided by other dimensions on your card.

Example

Let's say that you have a number dimension called Due date, and you'd like to compute another date, e.g. 3 days before deadline. The formula might be the following:

_.due_date - P3D

The expression language

The expression language uses Elo, that can be used to compute any date you'd like. In those expressions:

  • _ denotes the current card, on which the computed value applies,
  • _.xxx denotes the card value along the dimension whose name is xxx (in snake_case format ; if your dimension is named Due date, the variable is due_date)
  • NOW, TODAY are constants with obvious date & time semantics
  • D2026-03-26 is a date literal
  • SOD means Start Of Day ; EOD means End Of Day
  • SOW/EOW, SOM/EOM, SOY/EOY can be used similarly for weeks, months and years
  • Elo also supports durations, such as P1MT2H (1 month and 2 hours). Check the language reference.

How to find the dimension codes ?

In the formula editor, pressing _. should provide you with a suggestion showing the list of dimensions :

Compute a number - autocompletion.png

For a particular dimension, you'll find the code to use in formulas in the General panel when editing it :

Compute a number - dimension code.png

Where to get help ?

Writing formulas is always a bit difficult for non-tech. Jump on our Klarocardistas community to get immediate help.

Going further

  • Starting with Klaro Cards 0.259.0, Klaro Cards uses Elo which is simple, clean and powerful. The documentation online is certainly worth a read.
  • For business instances on earlier versions, Klaro Cards still uses the Livescript language.

See also

Nothing to read here

You have no article in this section.

Go back