Overview
The subject model helps simplify multi-table analysis in FineBI to improve analysis efficiency.
To truly master the use of the subject model, you need to understand the principles of the subject model and how it connects multiple tables.
Example
In multi-table analysis, Join easily introduces redundant data, resulting in duplicate rows in the resulting table.
For example, Target Table records the target sales data for each region, and Sales Detail Table records the specific sales data.
To determine whether the sales in each region have reached the target value, you need to perform a multi-table analysis on these two tables.
The following two sections show the differences between Join and the subject model in multi-table analysis.
Effect of Join
You can download the sample data Target Table and Sales Detail Table.xlsx.
Create an analysis subject. Perform Join on Sales Detail Table and merge Target Sales into Sales Detail Table, as shown in the following figure.
This will cause the Target Sales field data to inflate and duplicate. For example, the Target Sales data of New York and Michigan are inflated from one record to two records.
When checking whether the regional sales volume lives up to the target sales in the component, you can find that the data duplication caused by Join results in calculation errors during the summary, leading to incorrect target sales of New York and Michigan.
In this case, how to avoid data inflation and obtain the correct result?
Effect of the Subject Model
Similarly, you can try with the subject model.
Create an analysis subject and add data. Establish a model association between Target Table and Sales Detail Table, as shown in the following figure.
When comparing Sales Volume and Target Sales of Region in the component, the obtained values are correct without duplicate data issues.
You may wonder why Join produces redundant data, but the subject model does not. You can get the answer in the document Subject Model Merging Principle.
Subject Model Merging Principle
For details, see the next document Subject Model Merging Principle.