Note that instead of typing the names of your columns, you can select them in the field above the formula editor. That will save you from many typos.
Once you have created a new column, you can use it in your widget, there will be no difference between a column that is in the original dataset and a column computed with a formula.
In a formula, there are a lot of Serenytics functions you can use. For example, if you have a date column, you can use the function "extract_date_part" to extract its weekday (i.e. monday, tuesday...): "extract_data_part([MyDateColumn], "weekday")"
The most common functions are:
Note that any text has to be written between double quotes.
Please keep in mind to name your formula correctly as soon as you create it (the formula above was named "Purchase class").
Using this formula in a dashboard is very straightforward. It appears in all the selectors and you can use it as any other column of your data:
To add more condition statements, click on the "+" icon on the right of "Conditions":
Conditions are tested one after another. If a row validates the first condition, it will receive the value of the then statement of the first condition.
Pay attention that if you write:
Note that you can change the order of the conditions and delete them using the icons on the right of the "Then" statements.
From this tutorial and our documentation, you can now create a lot of formulas and kpis.
Try to keep in mind these best practices: