You can add a calculated value on Feature. Within the creation of a Calculated Value there are a bunch of options to create a specific Calculated Value, one of those tools are the Math Expressions. In this Lesson we will look at all the Math Expressions, and how you can use these in your Configuration models.
Best pactices - Math Expressions
Before we start with the Math Expressions, please consider reading the best practices below:
-
The number notation within the configurator is American. Therefore, use a dot when entering a decimal number.
-
Make sure that the Features being worked with always have a unit of Measurement. Otherwise, outcomes between -1 and 1 will not be shown.
-
If you want to use a Math Expression start in the Calculated Value window by typing Math.... You will then be presented with several options to choose from. Click on the option you want to enter, this also ensures that it is typed correctly.
Context
You sell different Boat models. One of those is the Maria Model tugboat. You decide you want the value of the calculations feature is rounded when a decimal number is used in the WIDTH or the Length Feature. So you want to add some logic to the calculations Feature. On top of that, you want to show the lowest value that is given within the Deck Size Feature. You want to show that through the deck size Feature itself.
Math Expressions - Tugboat case
To realize the solution for the wishes in the given context, follow the steps below:
-
Go to the Formulas Model
-
Open the Calculated value of the Calculations Feature
-
Add the variables: WIDTH and Length
-
Type: Math.Ceiling(@WIDTH*@Length)
-
Click on save
As stated in the Context, you want to show the square meters in the calculations Feature. But you want the value to be rounded (Up or Down). To add this to your Model, follow the steps below
Math.Ceiling (Value rounded up)
This function always returns the value of a given value, variable or calculation rounded up. In the example below, this causes 24 to be displayed in the Order Entry.
-
Add the variables: WIDTH and Length
-
Type: Math.Ceiling(@WIDTH*@Length)
-
Click on save
You have stated, that the value of the calculation @WIDTH*@Length will be rounded up.
Math.Floor (Value rounded down)
This function always returns the value of a given value, variable or calculation rounded down. In the example below, this will show 25 in the Order Entry.
- Add the variables: WIDTH and Length
- Type: Math.Floor(@WIDTH*@Length)
- Click on save
You have stated, that the value of the calculation @WIDTH*@Length will be rounded down.
Math.Min
This function returns the lowest value of the two values given.
You want to show the lowest value from either the WIDTH and the Length feature in the Deck size feature. To realize the solution for the wishes in the given context, follow the steps below
-
Go to the Formulas Model
-
Open the Calculated value of the Calculations Feature
-
Add Math.Min(@WIDTH, @Length)
-
Click on save
With this, you have stated that the Deck Size feature shows the lowest feature from the given values of WIDTH and Length.
Math.Max
This function returns the Highest value of the two values given.
You want to show the highest value from either the WIDTH and the Length feature in the Deck size feature. To realize the solution for the wishes in the given context, follow the steps below
-
Go to the Formulas Model
-
Open the Calculated value of the Calculations Feature
-
Add Math.Max(@WIDTH, @Length)
-
Click on save
With this, you have stated that the Deck Size feature shows the lowest feature from the given values of WIDTH and Length.
More Math Expressions
The formulas above are just a fraction of the possibilities with Math Expressions. There are many more possibilities to calculate different equations. You can read more about these on our Documentation page.
Comments
0 comments
Please sign in to leave a comment.