AX2344

Managing calculation types using Save Type 4

Using Save Type 4, you can create, edit, or delete calculation types by using save-to-database within a spreadsheet.

Each calculated field in a table is assigned a calculation type to determine how the values for the field are calculated. Axiom Software includes several standard calculation types that can be modified to accommodate industry-specific or organization-specific requirements. You can also add new calculation types if needed. The only way to modify calculation types from within Axiom Software is to use Save Type 4.

Save Type 4 depends on the placement of save-to-database tags within the sheet. There are three components:

  • The primary SaveStructure2DB tag, which defines the locations of the save-to-database control row and control column, and specifies the desired operation.
  • Column tags in the save-to-database control row, to specify the columns which hold the calculation properties.
  • Row tags in the save-to-database control column, to determine the action to take on the calculation type (save or delete).
Save-to-database tag summary
Tag Type Tag Syntax

Primary save-to-database tag

[SaveStructure2DB;Axiom.Calculations;CustomSaveTag=Name]

Row tags

[Save]

[Delete]

Column tags

See Calculation types for calculated fields for the full list of column tags.

NOTE: Save Type 4 must be enabled for the sheet on the file's Control Sheet in order for the save process to occur. For more information, see Using Save Type 4.

Placing the primary save-to-database tag in the sheet

To define the save-to-database process, place the following tag in any cell in the sheet, within the first 500 rows:

[SaveStructure2DB;Axiom.Calculations]

The row containing this tag becomes the control row for the process, and the column containing this tag becomes the control column for the process.

You can also optionally use the custom save tag parameter. For example:

[SaveStructure2DB;Axiom.Calculations;CustomSaveTag=SaveCalc]

NOTES:  

  • The primary SaveStructure2DB tag must be located in the first 500 rows of the sheet.

  • The SaveStructure2DB tag can be placed within a formula, as long as the starting bracket and identifying tag are present as a whole within the formula. For more information, see Using formulas with Axiom feature tags.

Defining the calculation properties in the control row

Within the control row for the save-to-database process, specify the columns that define the calculation properties by entering the reserved column names from Axiom.Calculations. See Axiom.Calculations and Calculation types for calculated fields for information on these columns.

The column tags can be placed to either the right or the left of the SaveStructure2DB tag. The only required column is CalculationName. Any column that is omitted will use the default setting when the calculation type is saved (whether you are saving a new item or updating an existing one).

The control row must be dedicated to containing only valid column names for the Save Type 4 operation to the target table. Any invalid entries in the control row will cause an error when saving.

Flagging the rows to save or delete

Within the control column for the save-to-database process, mark each row that you want to be processed with the appropriate row tag:

Row Tag Description

[Save]

Saves the calculation type with the specified properties.

If any value is invalid for a particular setting, then the save will not occur. If a column is omitted from the save, the calculation type will use the default setting (whether you are saving a new item or updating an existing one).

NOTE: If you have defined a custom save tag in the SaveStructure2DB tag, then you must mark the rows with that tag instead of the default tag. For example, if your primary tag is [SaveStructure2DB; Axiom.Calculations; CustomSaveTag=MySave] then you would place the tag [MySave] in the rows that you wanted to be saved.

[Delete]

Deletes the calculation type from the database.

A calculation type cannot be deleted if it is used by any calculated fields.

Only rows that are marked with a valid tag are processed; all other rows are ignored, even if there is content in the property columns. If a row contains a valid tag but no content exists in the property columns, a save error will occur.

When the save-to-database occurs, delete actions are processed first, followed by save actions.

NOTE: The row tag can be placed within a formula if desired. For example, you might want to use a formula to determine whether a particular row should be saved or deleted.

Populating calculation types in the spreadsheet

In order to update existing calculation types, you can use an Axiom query against the Axiom.Calculations table to bring in the current values. Once you have the current values as a starting point, you can adjust them as necessary, and then save changes back to the database. This may also be useful when creating new calculation types, so that you can compare the settings for the new types against the settings for existing calculation types.

All entries in the calculation properties must match the valid values for the column. See Calculation types for calculated fields for more information on each column and allowed values.