Firstly, a point that needs clarification: I put duplicate in quotes in the title because they aren't really duplicate rows, but the legitimate product of a join. However, for my aggregate calcs, I consider them duplicates.
My scenario (simplified for clarity):
I have a Webi report that pulls data from 3 different tables / objects in the universe. It is insurance claim details, but you can think of it in the classic Order header, order detail scenario.
The first table is the parent (header) and contains claim data such as name, location, etc.
Second table is a child (detail) table and it contains financial data, or the measures. This data is a finer grain (a classification sub-type), but for report purposes, this is aggregated (summed) back up to the grain of claim type, but still a finer grain than the claim (header) data. So the result is a claim record, and 2 claim type financial records with their dollar amounts There is another table, Notes, that has a 0 to many relationship to the Claim table. The 3 tables link together on a common claim Id. The relationships are defined at the data foundation layer in the universe The data looks like this:
Claim# 12345 Claimant: John Doe <----- Claim record
(Claim type) Paid Reserved Total <---- Summed measures
Medical 100 1000 1100
Expense 200 4000 4200
Total 300 5000 5300
Notes: Note 1 <----- Notes
Note 2
Note 3
Claim# 23456 Claimant: Jane Doe
...
The calculations (aggregate sums) are fine, until there is more than one note. This data is all one big query within the report, so these dollar amounts get inflated as notes count increases. If a claim has 2 notes, the totals all get doubled, 3 notes triples them and so on.
I have tried a couple of solutions for my problem, but can't seem to get either to work.
1. I split out the big query into 2 separate queries. 1 with the claim and financial data, and the other with the Notes (uses "result from another query" filter mechanism). When I do this, if I don't merge the dimensions, the measures amounts are correct, but the child notes table in the report doesn't get filtered by the claim's claim number, but rather displays all notes for each claim. If I merge the dimensions on the common claim Id column, then the report only displays the notes data, but not the claim or measures data.
2. I have tried to keep the 1 big query and use the built in context functions to attempt to change the context at which the aggregations calculate. Namely, I tried the ForEach function to exclude the Notes from the calculation.
My question is this:
Which solution is the preferred method of solving my problem? If not either, then what technique should I use?
I'm using SAP / Web Intelligence Desktop, v14.0.11