Monetize360

Potential Savings Multi-Bank

Calculate potential savings summary from multi-bank fee analysis by comparing rates across banks

Potential Savings Multi-Bank

Calculate potential savings summary from multi-bank fee analysis. The function compares fees across multiple banks, groups data by categories, and returns the total potential savings for categories configured with savings calculation enabled.

Technical Name: PotentialSavingMultiBankFunc

Properties

  • Execution Mode: SYNC
  • Type: NATIVE
  • Category: System Functions
  • Function ID: 66e31772-bde2-4a8f-801d-c215b5cdc327

Input Schema

Required Parameters

ParameterTypeDescription
dataobjectReport configuration object (MReportMaster) containing query with bank fee data

The report query should include the following fields:

  • bank_name - Name of the bank
  • name - Category name
  • total_charges - Total charges for the service
  • volume - Transaction volume
  • forex_rate - Foreign exchange rate for currency conversion

[Image placeholder: PotentialSavingMultiBank function configuration panel]

Input Example

{
  "data": {
    "reportConfig": {
      "query": {
        "selectFields": [
          {
            "fieldName": "bank_name",
            "fieldAlias": "Bank"
          },
          {
            "fieldName": "name",
            "fieldAlias": "Category"
          },
          {
            "fieldName": "total_charges",
            "fieldAlias": "Total Charges"
          },
          {
            "fieldName": "volume",
            "fieldAlias": "Volume"
          },
          {
            "fieldName": "forex_rate",
            "fieldAlias": "Forex Rate"
          }
        ],
        "fromClause": {
          "mobjectId": "bank-fee-mobject-uuid"
        }
      }
    }
  }
}

Output Schema

FieldTypeDescription
resultobjectSummary object containing savings metric

The result object contains:

FieldTypeDescription
Savingsnumber (long)Total potential savings (rounded to nearest integer)

Output Example

{
  "result": {
    "Savings": 15000
  }
}

[Image placeholder: Potential savings output visualization]

How It Works

The function performs the following analysis:

  1. Currency Conversion: Converts all charges to USD using forex rates:

    total_charges_converted = total_charges × forex_rate
  2. Groups by Bank and Category: Groups fee data by bank name and category

  3. Calculates Per-Unit Prices: Computes average price per unit for each bank-category combination:

    per_unit = total_charges / total_primary_volume
  4. Organizes by Category: Structures results hierarchically by category and bank

  5. Calculates Potential Savings: For categories with include_l3_savings flag enabled:

    • Compares per-unit prices across banks
    • Calculates potential savings by identifying the minimum rate
    • Aggregates savings across all eligible categories
  6. Returns Summary: Returns total potential savings (rounded to nearest integer)

Category Configuration

Potential savings are only calculated for categories that have the include_l3_savings flag set to true in the Category Object. Categories without this flag will have savings set to 0.

Use Cases

Multi-Bank Savings Summary

Get a quick summary of potential savings across multiple banks:

{
  "data": {
    "reportConfig": {
      "query": {
        "selectFields": [
          {"fieldName": "bank_name", "fieldAlias": "Bank"},
          {"fieldName": "name", "fieldAlias": "Category"},
          {"fieldName": "total_charges", "fieldAlias": "Charges"},
          {"fieldName": "volume", "fieldAlias": "Volume"},
          {"fieldName": "forex_rate", "fieldAlias": "Forex"}
        ],
        "fromClause": {
          "mobjectId": "bank-fee-mobject-uuid"
        }
      }
    }
  }
}

Savings Dashboard

Display total potential savings in a dashboard:

Start → FetchMData(Bank Fees) → PotentialSavingMultiBank → DisplayDashboard → End

[Image placeholder: Workflow example]