PhixFlow Help

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

By the end of this chapter you will be able to:

  • Combine data sets (a union) with a calculate stream
  • Record the source for each record in a stream
  • Use the internal variable _pipeName

In this exercise you will produce a single list of updates to customers' Cable TV packages. Customers can update their packages both through a Customer Care system and in shops. You will bring all these updates together into a single list.

Read in Data Sets from Files

For this exercise you need two files from the zip file you downloaded in  2 Using Excel Templates, step 5.
containing updates from the two sources (Customer Care, and Shop).

  • Customer Care updates: this file containing details of customer care updates can be found in the input files, at:
    <path>\train\inputData\ChannelPackages\CustomerCareUpdates\CustomerCareUpdates.txt
  • ShopUpdates.txt
    A file containing details of shop updates can be found in the input files, at:
    <path>\train\inputData\ChannelPackages\ShopUpdates\ShopUpdates.txt
  1. Create a new model with Name Channel Package Check.
  2. Add a file collector to your model.
    1. Set Name to Customer Care Updates.
    2. Navigate to the directory …\inputData\ChannelPackages\CustomerCareUpdates.
    3. Select the file CustomerCareUpdates.txt  and complete the automatic file collector and stream configuration.
  3. Add another file collector to your model.
    1. Set Name to Shop Updates.
    2. Navigate to the directory …\inputData\ChannelPackages\ShopUpdates.
    3. Select the file ShopUpdates.txt  and complete the automatic file collector and stream configuration.
  4. Run both streams and check that data from the files is loaded into each one.

Combine Data Sets

  1. Create a new stream in your model.
    1. Hover over CustomerCareUpdates and click  Add a new Stream.
    2. Set the Name to  Combined Updates.
    3. Drag all attributes from CustomerCareUpdates into Combined Updates.
  2. Save your model layout.
  3. Add a pipe from the other stream.
    1. Hover over ShopUpdates and click  Add a new Connector.
    2. Click Combined Updates to link the pipe to the output stream.
  4. 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 to remove the in. prefix. Change in.CustomerRef to CustomerRef.
  5. Press  in the main stream configuration form.
  6. Run analysis on Combined Updates.
  7. Check that you have the correct number of records in this stream when the analysis is complete.
  8. 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 your configuration to record the source for each update, in the set of combined updates. To do this:

  1. Update the name of the pipe from the stream CustomerCareUpdates.
    1. Double-click on the pipe to open its configuration form.
    2. Update the Name to CC.
    3. Press  to save your changes.
  2. Update the name of the pipe from ShopUpdates to shop.
  3. Double-click the stream Combined Updates to open its configuration form.
  4. In the Attributes section, add a new attribute and set:
    1.  Name: Source.
    2. Expression :

      if (_pipeName == "CC",
       "Customer Care"
       ,
       "Shop"
       )
  5. To make Source the first attribute in the stream, drag it to the top of the attributes list.
  6. Press  in the main stream configuration form.
  7. Run analysis on Combined Updates.
  8. Check the output data set and make sure that the source has been recorded on each record correctly.
  • No labels