Name-Value Maps - WorkView - Foundation 24.1 - Foundation 24.1 - Ready - OnBase - Premier - external - Premier

WorkView

Platform
OnBase
Product
WorkView
Release
Foundation 24.1
License
Premier

Name-Value Maps can be used to accumulate values based on another value. For example, you can use these when iterating over an invoice to accumulate a total for each invoice status value, or perhaps a total per customer state, or both. Example:

<<CreateDataSet: AmountByStatus>>
<<CreateDataSet: AmountByState>>
<<Filter:Invoices - All Invoices>>
<<AddToDataSet: AmountByStatus, status, amount>>
<<AddToDataSet: AmountByState, customer.state, amount>>
<<End>>

Name-Value Map values can be iterated over in their own template block or fed directly into a chart block (see Charting and IterateNameValueMap in Iterate Name Value Map Matrix). A Name-Value Map has addressable data attribute named “Name”, “Value”, and “Percentage” (of total). Example:

<<IterateNameValueMap:AmountByStatus, -Value>>
<<@Name>>
<<@Value, Currency>>
<<@Percentage, {0.00}>>%
<<End>>
Note:

If accumulating values from filter results simply for charting, it is more efficient to use the FilterAsChart block, as aggregate values will be obtained from the database in a single query. Use Name-Value Maps for charting if you are walking all of the data anyway or if the values being charted as already accumulated in a single source object.

CreateNameValueMap

Creates a NameValueMap structure in memory and gives it the name provided. Example:

<<CreateNameValueMap: AmountByStatus>>

ClearNameValueMap

Will clear the specified NameValueMap, allowing it to be reused (if desired) by another template section. This can be used when accumulating values inside an iteration block, where each iteration should calculate its own set of values. Example:

<<ClearNameValueMap: AmountByStatus>>

AddToNameValueMap

Adds a name and value to the specified NameValueMap. If the specified name already exists in the map, the value part is added to the existing value, otherwise the name and its value are added to the map as new. If the amount is not provided, it is assumed to be a value of 1.

<<AddToNameValueMap: AmountByStatus, status, amount>>

GetValueFromMap

Returns the value from the named Name-Value map currently assigned to the specified name/key. If an optional variable name is provided as a third parameter to this tag, any value found will be assigned to the named variable. If no variable is specified, the value is added to the output stream as a direct part of the report. Example:

<<GetValueFromMap: “CountByStateMap”, @stateName, varStateCount>>