What & Why
The problem. Intercompany fee shares are entered in D365 as a single forecast cost line in the sending company (the From side). No corresponding record exists in the receiving company, so the WIP forecast shows nothing for the receiving entity and the group position does not net to zero.
The solution. The Silver staging layer generates the missing To record for every qualifying From line. Each generated record carries the receiving entity's dimensions, an equal and opposite amount, and a distinct source table value so it is always traceable back to the original line.
How a To-Record Is Built
The derivation, step by step. Proven end to end on QA transaction ES05-007667: from es05 to ES08, resource ES005058, giving Office 3301 (Barcelona) and Department 3303 (Residential Capital Markets).
| Step | What | How |
|---|---|---|
| 1 | Identify the From lines | Forecast cost lines matching Rule 6, Intercompany Payaway Cost: projforecastcost with a category ending "(I)". Expected to be single-rule matches only. |
| 2 | Find the To legal entity | The Intercompany financial dimension on the line's default dimension set names the receiving company (e.g. ES08). |
| 3 | Find the target resource | The line's svsgbutargetresourceid holds the personnel number of the person the fee is shared to, resolving to a worker record. |
| 4 | Find their employment in the To entity | The worker has one employment per legal entity. Take the employment in the To entity that is date-effective on the line's project date. If more than one version matches, exactly one is picked deterministically (latest valid-from wins); if none matches, the record is still built with unknown dimensions. |
| 5 | Take Office and Department | Read from that employment's own financial dimension defaults. These become the To record's Office and Department. |
| 6 | Derive Division | Re-derived from To Office + Department + company via the master dimension mapping, the same way as every other row in the fact. |
| 7 | Set the remaining fields | Line property becomes FShareTo (the From line carries FShareFrom). Amount is equal and opposite so the pair nets to zero. Project, category, date, currency, model and transaction reference carry over unchanged. |
| 8 | Keep it traceable | The generated row keeps the original RecID with source table projforecastcost_icshareto, so generated rows are identifiable and trace straight back to their source line. |
Changes Required
All in the Silver layer; no Gold load proc changes expected.
| Item | Status | Change |
|---|---|---|
landing.projforecastcost |
Pending | Expose svsgbutargetresourceid; the column exists in dbo but is not in the view. |
staging.factforecastnetrevenue |
Pending | New UNION arm generating the To records per the steps above. |
staging.factforecastnetrevenue_rules |
Pending | Classify the new source table with its Net Revenue Type. |
| Gold dimension coverage | Pending | Verify DimDepartment and the division mapping cover the receiving entities' combinations. |
Open Decisions
| Decision | Status | Detail |
|---|---|---|
| Net Revenue Type | Open | Which type the generated rows classify as. Proposed: Intercompany Payaway Revenue. |
| Failure policy | Decided | Always generate. When the resource, employment or mapping is missing, the To record is still built with unknown dimensions so the group nets to zero; a verification query lists these rows as the data-quality worklist. |
| QA test record | Open | QA has no Rule 6 data. Need an example record, ideally with per-company employment dimensions that differ, so a wrong-company join would be caught. |