POS Transaction Analyzer User and Installation Guide, SST Version 1.2
Appendix N 190
Appendix N
Implementing Dynamic Metric
POS/TA supports the feature of implementing dynamic metric to add user defined columns in the stats table.
Follow the steps given below to add dynamic metric in POS/TA:
1. Create a SQL function that defines the logic to evaluate the corresponding metric.
2. In CUSTOM_METRIC table of POSDB database, add the entry of the metric as:
• MetricID: The ID to refer to the metric
• MetricDataType – The return type of the metric
• MetricName: The name of the metric
• MetricType: The type of metric (SUM/COUNT/MIN/MAX)
• FunctionName: The SQL function name which contains the definition of the metric. The name of the
TRANSACTIONS table fields can be passed in the function by specifying the name of the field. We can
also pass configurable values mentioned in the INI files into the function by using the name of the
parameter value in “%%”.
A sample statement to insert data in CUSTOM_ METRIC table
insert into [CUSTOM_METRIC]
values(1,'int','TotalApprovedWithdrawal','COUNT','TotalApprovedWithdrawal(
transTypeCode,transResponseCode)')
3. The MetricName defined in this table is added as a column in STATS, HOURSTATS, DAILYSTATS,
WEEKLYSTATS, MONTHLYSTATS and GLOBALSTATS tables respectively with its corresponding data types.