Difference between revisions of "Custom Field Type: Special – Calculated Value"

From SmartWiki
Jump to: navigation, search
 
Line 1: Line 1:
<u>'''General Description'''</u>
+
=='''General Description'''==
  
 
Executes an expression to calculate a value and store the result.  Additional information can be found in the [[SmartSimple]] wiki.
 
Executes an expression to calculate a value and store the result.  Additional information can be found in the [[SmartSimple]] wiki.
 
 
<u>'''Field Options'''</u>
+
=='''Field Options'''==
  
 
* '''Allow Empty''': N/A
 
* '''Allow Empty''': N/A
Line 11: Line 11:
 
* '''Store To Value''': N/A
 
* '''Store To Value''': N/A
 
 
<u>'''Special Options for Field'''</u>
+
=='''Special Options for Field'''==
  
 
'''Expression''' – defines the expression to be executed.
 
'''Expression''' – defines the expression to be executed.
Line 21: Line 21:
 
''ParseFloat([Total Monthly Cost]) + ParseFloat([Total Cost Ex]) + ParseFloat([Hardware Rental]) + ParseFloat([Email]) + ParseFloat([Other])''
 
''ParseFloat([Total Monthly Cost]) + ParseFloat([Total Cost Ex]) + ParseFloat([Hardware Rental]) + ParseFloat([Email]) + ParseFloat([Other])''
 
 
<u>'''Field Validation'''</u>
+
=='''Field Validation'''==
  
 
* '''Type''': N/A
 
* '''Type''': N/A
Line 28: Line 28:
 
* '''HTML Tag''': N/A
 
* '''HTML Tag''': N/A
 
 
<u>'''Field Formatting Options'''</u>
+
=='''Field Formatting Options'''==
  
 
* '''Height''': N/A '''Measure''': '''Default''':
 
* '''Height''': N/A '''Measure''': '''Default''':
Line 36: Line 36:
 
* '''Tool Tip''': Yes
 
* '''Tool Tip''': Yes
 
 
<u>'''Notes'''</u>
+
=='''Notes'''==
  
 
You can use arithmetic, string, comparison operators and functions within the calculated [[Custom Field|custom field]].  
 
You can use arithmetic, string, comparison operators and functions within the calculated [[Custom Field|custom field]].  
Line 42: Line 42:
 
* The calculations are performed when you click the '''Save''' button and save the page.  
 
* The calculations are performed when you click the '''Save''' button and save the page.  
  
<u>'''Important Notes on Calculation Order'''</u>
+
=='''Important Notes on Calculation Order'''==
 +
 
 
* Calculated field formulas are executed in the same order that the calculated fields are displayed on the page.  
 
* Calculated field formulas are executed in the same order that the calculated fields are displayed on the page.  
 
* You must not place fields that perform summary calculations based on other calculated fields ABOVE the subordinate calculations.  
 
* You must not place fields that perform summary calculations based on other calculated fields ABOVE the subordinate calculations.  
 
* If the fields are ordered in this manner, saving the page will not update the summary calculation, as summary formula will be executed BEFORE the subordinate calculations are performed.
 
* If the fields are ordered in this manner, saving the page will not update the summary calculation, as summary formula will be executed BEFORE the subordinate calculations are performed.
 +
 +
==SmartSimple Calculated Field Operators==
 +
 +
===Arithmetic Operators===
 +
 +
[[Image:Image:CS08.png]]
 +
 +
===String Operators===
 +
 +
[[Image:CS081.png]]
 +
 +
===Comparison Operators===
 +
 +
[[Image:Image:CS084.png]]
 +
 +
===Date Functions===
 +
 +
[[Image:Image:CS085.png]]
 +
 +
===Other Functions===
 +
 +
[[Image:Image:CS086.png]]
  
 
[[Category:Custom Fields]]
 
[[Category:Custom Fields]]

Revision as of 22:05, 6 October 2008

General Description

Executes an expression to calculate a value and store the result. Additional information can be found in the SmartSimple wiki.

Field Options

  • Allow Empty: N/A
  • Default Text: N/A
  • Options: Expression
  • Track Changes: Yes
  • Store To Value: N/A

Special Options for Field

Expression – defines the expression to be executed.

All values are treated as strings. For arithmetic operations, PARSEINT and PARSEFLOAT functions are used to convert the string value to a numeric value.

Example summing the values using five custom fields:

ParseFloat([Total Monthly Cost]) + ParseFloat([Total Cost Ex]) + ParseFloat([Hardware Rental]) + ParseFloat([Email]) + ParseFloat([Other])

Field Validation

  • Type: N/A
  • JavaScript Validation: N/A
  • Message: N/A
  • HTML Tag: N/A

Field Formatting Options

  • Height: N/A Measure: Default:
  • Width: N/A Measure: Default:
  • Number Format: Yes
  • Style: Yes
  • Tool Tip: Yes

Notes

You can use arithmetic, string, comparison operators and functions within the calculated custom field.

  • References to other fields are always enclosed in square brackets: [variable1]
  • The calculations are performed when you click the Save button and save the page.

Important Notes on Calculation Order

  • Calculated field formulas are executed in the same order that the calculated fields are displayed on the page.
  • You must not place fields that perform summary calculations based on other calculated fields ABOVE the subordinate calculations.
  • If the fields are ordered in this manner, saving the page will not update the summary calculation, as summary formula will be executed BEFORE the subordinate calculations are performed.

SmartSimple Calculated Field Operators

Arithmetic Operators

File:Image:CS08.png

String Operators

CS081.png

Comparison Operators

File:Image:CS084.png

Date Functions

File:Image:CS085.png

Other Functions

File:Image:CS086.png