...
Read in Data Sets from Files
- Create a new model with Name
Channel Package Check
.
There are For this exercise you need two files containing updates from the two sources (Customer Care, and Shop).
- Customer Care updates
A file containing details of customer care
...
- updates can be found in the input files, at:
…\inputData\ChannelPackages\CustomerCareUpdates\CustomerCareUpdates.txt - Shop updates
A file containing details of shop updates can be found in the input files, at:
…\inputData\ChannelPackages\ShopUpdates\ShopUpdates.txt
...
- Create a new model with Name
Channel Package Check
. - Add a file collector to your model
...
- .
- Set Name to
Customer Care Updates
. - Navigate to the directory …\inputData\ChannelPackages\CustomerCareUpdates.
- Select the file CustomerCareUpdates.txt
- Set Name to
...
- and complete the automatic file collector and stream configuration.
- Add another file collector to your model
...
- .
- Set Name to
Shop Updates
. - Navigate to the directory …\inputData\ChannelPackages\ShopUpdates.
- Select the file ShopUpdates.txt
- Set Name to
...
- and complete the automatic file collector and stream configuration.
- Run both streams and check that data from the files is loaded into each one
...
- .
Combine
...
Data Sets
- Create a new stream in your model
...
- .
- Hover over
CustomerCareUpdates
and
- Hover over
...
- click
...
- Add a new Stream.
...
- Set the
...
- Name to
Combined Updates
. - Drag all attributes from
CustomerCareUpdates
- Name to
...
- into
Combined Updates
.
- into
...
- Save your model layout.
- Add a pipe from the other stream
...
- .
- Hover over
ShopUpdates
and
- Hover over
...
- click
...
- Add a new Connector.
...
- Click
Combined Updates
to link the pipe to the output stream
- Click
...
- .
- Double-click on
Combined Updates
to open
...
- its configuration form
...
- and set the attribute expressions.
PhixFlow automatically adds a reference to the input pipe name at the start of each expression. To make the union work, you need to update the expression for each attribute
...
- Update the expression
Code Block |
---|
in.CustomerRef |
to
...
- to remove the
in.
prefix. Changein.CustomerRef
toCustomerRef
. - Press in the main stream configuration form.
- Run analysis on
Combined Updates
. - Check that you have the correct number of records in this stream when the analysis is complete.
- Check the data set you generated
...
- to make sure that every field in every output record has been populated.
Record
...
the Source for Each Update
You will now update you your configuration to record the source for each update, in the set of combined updates. To do this:
- Update the name of the pipe from the stream
CustomerCareUpdates
...
- .
- Double-click on the pipe to open
...
- its configuration
...
- form.
- Update the Name
...
- to
CC
. - Press to save your changes.
- to
- Update the name of the pipe from
ShopUpdates
...
- to
shop
. - Double-click the stream
Combined Updates
to open
...
- its configuration form
...
- .
- In the Attributes section, add a new attribute and set:
- Name:
Source
. Expression :
Code Block if (_pipeName == "CC", "Customer Care" , "Shop" )
- Name:
...
- To make
Source
the first attribute in the stream
...
- , drag it to the top of the attributes list.
- Press in the main stream configuration form.
- Run analysis on
Combined Updates
. - Check the output data set and make sure that the source has been recorded on each record correctly.