Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: awilliams1024As Stony says, within a single data set all records must have the same fields (even if they contain NULL values in some fields).
You can separate a data set into multiple subsets and then append additional fields to each subset. However, if you then want to recombine these subsets into a single dataset then the combined dataset would need to be a union of all the fields across all the subsets, with the 'missing' fields in each record given a value (e.g. NULL).
The attached dataflow shows some options. The top section of the dataflow illustrates how the input dataset can be split into the subsets and then additional fields appended to each subset, as required. If you want to combine the subsets, the Cat node can be configured to generate the union of all fields - which will insert NULL values into the 'missing' fields in each record. This example is designed for clarity of the logic rather than optimized performance as it requires multiple stages to process the data.
The second example in the middle of the dataflow shows how this processing could be achieved in a single stage - at the expense of additional complexity within the Filter node.
However, I think that both of these approaches are relatively 'rigid' solutions in that the Filter nodes need to be configured with separate output pins to reflect each of the values in the reference field ('client value'). You may want to consider using another approach to create the combined data set such as using a Lookup (or a Xref) with some reference data to drive the enrichment of the input dataset (see the example at the bottom of the dataflow). The combined data has been sorted for clarity of the example in this case.
Add_Fields_based_on_Field_Values.brg
Regards,
Adrian