...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
- Use an output multiplier to break out a record into multiple output records
In this exercise you will load reference data into your model which lists all the TV channels offered in each package. You will use this to break out each customer record, in Latest Package Update, into a set of records for each channel that the customer has ordered.
...
...
- Create a Database Collector, using the Datasource Rating and Billing, to read all the records from this table
- Create a Stream from this Database Collector
- Run Analysis on the Stream to read in data from the table into the Stream
...
Add a new Stream to your model to hold the full channel list:
- Create a Stream using the Add a new Stream button in the tool bar from Latest Package Update
- Give the new Stream the Name Latest Package All Channels
- Drag all attributes from Latest Package Update to Latest Package All Channels
To complete the configuration:
- Add a lookup pipe from SOURCE_PACKAGE_CHANNELS into Latest Package All Channels
- Call the pipe chan
- In the matching attributes form create a match:
- Left-hand attribute to PACKAGE
- Right-hand attribute to Package
- Update the right-hand matching attribute:
- Double-click on the match
- Update the Index Expression filed from _out.Package to: in.Package
- Save your changes
...
...
...
- Open the configuration form for the Stream Latest Package All Channels by double-clicking it
- Go to the Advanced tab
- In the field Output Multiplier, enter the value: chan.CHANNEL
This means that for each output record processed, CenterView will look up the list of channels for the package from the reference Stream; it will then work through the list returned, handling each element from the list in turn and generating an output record in the Stream for each one
- Add an Attribute to the Stream with Name Channel
- Set the Expression of this Attribute to _outputMultiplier
This will print the value of the current element from the Output Multiplier list to this field
...