In this lesson, we delve into the concept of On-the-Fly data processing using Model Functions. This powerful feature ensures that any changes to your input data automatically and instantaneously update the output without requiring you to reactivate or rerun the function. This seamless recalculation is known as On-the-Fly calculation and it is an essential property applicable to all Model Functions.
Key Features of On-the-Fly Calculation
Automatic Updates: One of the most significant advantages of using Model Functions is their ability to immediately reflect changes in input data. This property eliminates the need for manual reactivation or rerunning of the function. Simply saving the modified data is sufficient to trigger the recalculation and update the output.
For example, suppose you're managing a financial model that forecasts quarterly revenue based on various input parameters such as sales data, marketing spend, and operating costs. If there is an update in the sales data, the Model Function immediately adjusts the revenue forecast accordingly, ensuring that your financial projections are always up-to-date.
Consistency Across Functions: The On-the-Fly feature is applicable to all Model Functions. Whether you're working with financial models, operational optimizations, or complex data transformations, you can rely on this feature to maintain the accuracy and currency of your outputs.
Practical Insight
Consider a scenario where a sales manager must generate reports based on real-time sales data. With the On-the-Fly calculation property, any new sales figures entered into the system instantaneously update the related Model Functions. This immediate reflection ensures that the sales manager always has access to the most current and accurate data, facilitating timely decision-making.
Practical Example
Let's look at a practical example to demonstrate the dynamic capabilities of Model Calculations. This example will illustrate how changes to input formulas are automatically reflected in the calculated fields within your environment, showcasing the efficiency and immediacy of on-the-fly calculations.
Example Scenario: Updating a Financial Model
Scenario: Suppose we have a financial model where we calculate TotalIncome (*) using a formula (sum) that includes various income components such as: Tax Free Income + CapitalGains + Dividends + Other Income.
Requirement: Now, the requirement changes, and we need to recalculate the TotalIncome to include only Tax Free Income + Capital Gain + Dividends, excluding Other Income.
Updated Formula: Total Income = Tax Free Income + Capital Gains + Dividends
Automatic Update: Upon reactivation of the environment, the calculated field for "Total Income" will automatically update based on the new formula (check the TotalIncome numbers for Sunshine Holding (Sunshine) row).
Immediate Effect: You will see the updated calculated field instantly, reflecting the new total income of 1400 instead of the previous 1800.
This exemplifies how changes are seamlessly and automatically applied within the system, enhancing efficiency and accuracy.

Building on our previous example, let's explore how changes in input data, in addition to changes in formulas, can impact the results in real-time using Model Calculations. This ensures a dynamic and responsive environment where both the formula and input data can drive updates to calculated fields.
Initial Input Data
| Field | Value |
|---|---|
| Tax Free Income | 500 |
| Capital Gains | 500 |
| Dividend | 400 |
| Other Income | 400 |
New Input Data
| Field | Value |
|---|---|
| Tax Free Income | 1000 |
| Capital Gain | 1000 |
| Dividend | 400 |
| Other Income | 400 |
Immediate Reflection: Upon reactivation, the calculated field for "Total Income" will automatically update to reflect the new input data.
Business Scenario: Picture an investment advisor who needs to provide clients with up-to-the-minute portfolio valuations. If any input data, such as market movements or income updates, changes, Model Calculations immediately update the total portfolio value. For instance, if capital gains and tax-free income values double, the total portfolio valuation adjusts in real-time, ensuring clients always see the most current information.

