Hierarchical Regroup - Multiple children-on the right track?
Posted: Wed Dec 14, 2016 5:50 am
Hierarchical Regroup - Multiple children - Am I on the right track?
Problem: I have a flat record coming in, representing a motor insurance quote. The quote may have multiple drivers, and each driver may have multiple claims and multiple convictions. So a tree structure with quote at the top, then driver, then claim and conviction both as a child of driver. I've done the joins upstream such that there will be one row for each combination of quote+driver+claim+conviction (that is, a quote with 2 drivers each with 1 claim and 1 conviction would generate 4 rows.)
This must be composed into an XML record of the same structure. So my intention is to regroup first on driver then on claim and conviction using the output of the Driver regroup as the input list.
Each driver has a unique number which I used as my key when regrouping drivers. In the hierarchical stage when selecting parent and child fields the key (Driver Number) goes in the parent list (Quote). Therefore when coming to regrouping claims and convictions using the result of the Driver regroup, the driver number is not available to use as a key.
This seems a bit of a design flaw. My intended workaround is to duplicate the Driver number field (called something like ConClaimDriverNumber) and include it in the child list at the Driver Regroup stage. I haven't tried this yet.
I'm a newbie with the hierarchical stage but this seems a bit counterintuitive; is there a more elegant solution? In other words, am I on the right track??
Problem: I have a flat record coming in, representing a motor insurance quote. The quote may have multiple drivers, and each driver may have multiple claims and multiple convictions. So a tree structure with quote at the top, then driver, then claim and conviction both as a child of driver. I've done the joins upstream such that there will be one row for each combination of quote+driver+claim+conviction (that is, a quote with 2 drivers each with 1 claim and 1 conviction would generate 4 rows.)
This must be composed into an XML record of the same structure. So my intention is to regroup first on driver then on claim and conviction using the output of the Driver regroup as the input list.
Each driver has a unique number which I used as my key when regrouping drivers. In the hierarchical stage when selecting parent and child fields the key (Driver Number) goes in the parent list (Quote). Therefore when coming to regrouping claims and convictions using the result of the Driver regroup, the driver number is not available to use as a key.
This seems a bit of a design flaw. My intended workaround is to duplicate the Driver number field (called something like ConClaimDriverNumber) and include it in the child list at the Driver Regroup stage. I haven't tried this yet.
I'm a newbie with the hierarchical stage but this seems a bit counterintuitive; is there a more elegant solution? In other words, am I on the right track??