ForceMerge() example

The Webi document is built on two queries. First query dimensions are Country and Resort:

There is only one dimension – Resort in the second query.

The queries are merged on Resort.

The first table in the result contains expected numbers. While in the second table, sum of Number of guests (565+446+540=1551) is duplicated for each Country. The explanation for this is that in the second table, dimension Resort is not used, so the queries are not merged:

Webi function ForceMerge can help in this situation.

ForceMerge forces Web Intelligence to account for synchronized dimensions in measure calculations when the synchronized dimensions do not appear in the calculation context of the measure

Using ForceMerge([Number of guests]) for the column will produce the following result:

Sometimes we have to use ForceMerge, sometimes it can improve performance of SQL queries. However try to avoid it if possible, this will make document logic more clear.