CMDBuild Forum

Calculating difference between 2 attributes

Hello everyone,

I'm am using CMDBuilld for a few day now, and I am building my own and better version of our old CMDB which is made in MS Access. I have 2 questions I haven't figured out yet:

(1)I am trying to build a Class where I want to manage my toners, drums etc.
I created an Attribute Stock (string), an Attribute Minimal required Stock(string) and an Attribute To order (string)

In the last attribute I want to calculatie de difference between my minimal required stock and my Stock. This difference is the number I need to order. Is it possible to calculatie this within an Attribute?

(2)I was trying to edit metadata on a Reference Attribute, but I cannot find a good example how to fill in this filter. I found the Appendix CQL language  in de Administrator manual, but it doesn't say what to put in de "Key" field and what to put in de "Value" field.

 

Regarding the first question, unfortunately it is not currently possible to define from the Administration Module formulas that perform calculations on attributes.
However, you can perform calculations by creating triggers on the database.
Or you can create a “view” or a “reports” that show the information
you need, simple or calculated.
Regarding the second question I suggest to you to download from SourceForge the CMDBuild “Ready2Use” database and look at filters set on the reference attributes of that data model.
CMDBuild Team