I. Overview
1. Problem description
Multiple datasets can be defined in a report, and the required data can be retrieved separately. The displayed data may come from multiple different tables or different libraries. How to sum up the data columns of different datasets?
2. Solutions
1) Combine the data of the dataset by writing SQL statements. This chapter will not go into details.
2) Put the two data columns of different data sets on the cells respectively, and sum up the two cells through the sum formula.
3) Use the dataset function to add directly.
II. Example 1: Summation using SUM
1. Report Design
1) Create two built-in datasets as shown below:
2) Drag the data column into the corresponding cell, and insert the formula in cell D1:sum(B1,C1), not expanded, as shown in the following figure:
3) Set the filter condition in cell C1:Product equals cell A1,As shown below:
2. Effect preview
Save, the paging preview is as shown below:
Embedded1.select(Sales_Volume, Product=A1) + Embedded2.select(Sales_Volume, Product=A1)
III. Example 2: Addition using the dataset function
1. Report Design
Use the formula directly:Embedded1.select(Sales_Volume, Product=A1) + Embedded2.select(Sales_Volume, Product=A1), where Embedded1 is the dataset name, as shown below:
The formula obtains the sales volume based on the expanded product, and then adds and sums the sales volume to obtain the sum of the two data sets.
Note: If you want to judge multiple conditions, you can add and, or conditions in the formula, && is an and relationship, || is an or relationship.