Compute dynamic categories

Learn here how to compute dynamic categories, using the Elo expression language

  1. What is a "Compute dynamic categories" dimension ?
    1. Example
  2. Creating values and their semantics
    1. Example
  3. The expression language
    1. How to find the dimension codes ?
  4. Where to get help ?
  5. Going further

What is a "Compute dynamic categories" dimension ?

This kind of dimension allows you to define categories (used in filters, kanban columns, etc. like values of other dimensions) and cards sorted automatically in them.

Example

Let's say that you have cards corresponding to projects with a Customer grade (A, B, C) and Budget dimension. You'd like to categorize cards according to the following criteria :

  • Any project with a budget of 10k€ or more, or a customer grade A is considered Critical.
  • Otherwise, if the budget is higher than 5k€ the project is Important
  • Otherwise, the project is of Normal priority

In Klaro Cards, you would normally create a Priority dimension with three values: Normal, Important, Critical.

Except you don't want to categorize cards manually. That's a situation where this kind of dimension is handy.

Creating values and their semantics

  1. Create an Advanced dimension with your three values, as usual. Make sure you select the "Compute dynamic categories" type of dimension.
  2. Then click on each value to define the semantics. An Elo field allows you to put an expression for each.

Example

For Critical :

(_.grade.id == 'a') or (_budget >= 10000)

For Important :

(_grade.id != 'a' and (_.budget in 5000 ... 10000)

For Normal :

(_grade.id != 'a') and (_.budget < 5000)

The expression language

The expression language uses Elo, that can be used to compute any number 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 Time spent, the variable is time_spent)
  • _.xxx.id denotes the identifier of the value, for dimensions with a list of values set on cards (simply use _.xxx for numbers, dates and free text)
  • _.xxx.semantics denotes the semantics value, for dimensions with numbers associated to values (second case of the earlier section)

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.
Go back

Article status changed.

Article status changed.

Article status changed.