Attribute types: Number and Percentage

Avatar
Alica Kačengová

Number lets you enter only numerical values and set their constraints, and Percentage allows you to display decimal numbers as a percentage.

When setting the type to Number, you have the following options:

  • Force sign – if turned on, there must be either plus or minus sign in front of the number.
  • Accounting negative numbers – if turned on, it puts brackets around negative numbers.
  • Compact mode – if turned on, it compacts big numbers, e.g. 10100 is displayed as 10k
  • Thousands separated – if turned on, it uses a default separator based on the currency, or comma if the currency is not set.
  • Rounding
  • Currency
  • Minimum and maximum

With Percentage, you can also set rounding:

If you attempt to enter value which doesn’t respect the constraint, it will be marked in red and you won’t be able to proceed (row 1). Existing values (which were entered before the constraint was created) that don’t respect the constraint (row 2) are highlighted as invalid.

You can of course enter numerical values into the column even if the type is not set at all (equal to set to None) or Text. Also, you will be able to perform calculations on those values – similarly to how you would do in a spreadsheet. However, the Number and Percentage attribute types gives you more power over the integrity of the values.

Example use case

Let’s demonstrate this on an example: We have this table containing data about projects:

Remaining portion is calculated as following: (Budget – Spent)/Budget

If we have budget 1500 and spent 300, the remaining portion will of course be 0.8:

But what happens if we enter 1000 and “abc”? Well, the result cannot be calculated and “NaN” (not a number) is displayed.

“abc” is an invalid value. We don’t want invalid values in our data, but mistakes can happen, especially if multiple people work with the same table. Setting the attribute type to Number solves the problem – if somebody tries to enter an invalid value, they just cannot proceed. If the value was entered before the type was set, it is highlighted (red underline) as invalid so you can easily spot and fix such an irregularity.

The next thing you can enforce with the Number type is that the values are from a certain range. Just set the minimum and/or maximum. The behaviour for invalid values is the same – old ones are highlighted, new ones cannot be saved.

The Percentage type works in the same way as the Number type (the value actually is a number), the only difference is that Lumeer treats the values as fractions and displays them as percents. As a result, instead of the following table

you would see:

It’s just a visual change, but if you look at a list of projects, there is a high chance that you will be able to process the information faster if you see percentage instead of a decimal number.

What can you do with numbers and percentages?

First, as we already mentioned, they can act as a function input (see manual on functions for more detail).

Second, you can display their values in a chart view. We first add a couple more values to the table:

And then configure the chart:

Thirdly, you can aggregate values across the rows in a pivot table. This complex pivot table comparing stock vs. demand of items across multiple depots is from Lumeer’s Supply chain management template:

Last but not least, you can use the percentage value to display tasks progress in timeline view. If we switch this table from Project tracker template

to a timeline view and configure it, you see tasks’ progress in each row (it is displayed in darker green):