If we preview our report, we will be able to see the following:
However, if we compare these results with the ones obtained by MySQL, we will note that the PRD groups are not being created properly.
As we can see, the highlighted customers appearing in our report belong only to Canada; that is, our report is showing incorrect results.
In order for the groups to be correctly formed, we need to go to the Structure tab, navigate to Master Report | Group, select it, and modify the following:
[country_id]
GroupCountry
What we just did was indicated to PRD that the groups should be formed by these registries, which share the same country_id
values. We could have put just country
instead of country_id
, but it is much more efficient to use fields of a numeric nature. With respect to GroupCountry
, it is the name by which this group will be referenced in our report.
PRD supports adding one or more grouping criteria, but in our case we will be using only one. If, for example, we had to use the city
field in addition to the country
field in order to create the appropriate groups, we should specify both grouping criteria in the corresponding Attributes.group characteristic.
If we preview our report, we will see that the groups are correctly formed. For example, the first page looks like the following:
And the second page like the following: