I. Overview
1. Problem description
For the recurring indicators in the template, sometimes we only want to sum the first occurrence of the value. As in the example below, Apple appears twice, and only the first time is summed.
2. Realization idea
Use the seq() formula to calculate the number of occurrences of the specified object, and sum the number of occurrences equal to 1.
II. Steps
1. Design report
1) Create a new built-in dataset Embedded1, as shown in the figure below:
2) Design the report as shown in the figure below, and set the A2 cell data as a list.
3) Fill in cell B3 with the formula: SUM(B2[!0]{SEQ(A2)=1})
2. Effect preview
Save the template, click Pagination Preview, the effect is as shown in I.1.
Note: Mobile terminal is supported.
III. Download template
Refer to the completed template: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\BasicApplication\Sum_first_occurrence.cpt
Click to download: