Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Dev-5545 Add static instruction. Update snapshots, add details about how the data should look

...

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 customer care system and in shops. You will bring all these updates together into a single list.

...

Read in

...

Data Sets from

...

  • Create a new model with Name: Channel Package Check

...

Files

For this exercise you need two files from the zip file you downloaded in  2 Using Excel Templates, step 5. The files contain updates from the two sources (Customer Care, and Shop).
Customer Care updates
A file containing details of customer care updated can be found in the input files, at:
: the customer care service and the shop.

...

  • <path>\train\inputData\ChannelPackages\CustomerCareUpdates\CustomerCareUpdates.txt

...

  • <path>\train\inputData\ChannelPackages\ShopUpdates\ShopUpdates.txt

...

  1. Create a new model with the Name Channel Package Check.
  2. Add a file collector to your model

...

  1. and load the data.
    1. PhixFlow displays a form for the new file collector. Set the Name to Customer Care Updates.
    2. In the model, hover over the Channel Package Check file collector to display the context toolbar.
    3. Click Image Added Upload Managed File
    4.  Navigate to the directory <path>\train\inputData\ChannelPackages\CustomerCareUpdates.
    5. Select the file CustomerCareUpdates.txt

...

    1. . and clickImage AddedUpload.
    2. PhixFlow adds a new stream to the model, called CustomerCareUpdates.
    3. In the model, hover over the new CustomerCareUpdates stream and clickImage Added Run Analysis.
    4. Check the data is loaded. There should be 8 lines of data, with columns for Customer Ref, Sales Date and Package.
    5. Now the data is loaded into the stream, set the stream to Image AddedStatic
  1. Add another file collector to your model

...

  1. and repeat the process described in step 2. This time:
    1. Set the file collector Name to Shop Updates.
    2. Upload <path>\train\inputData\ChannelPackages\ShopUpdates

...

    1. \ShopUpdates.txt

...

    1. .
    2. PhixFlow loads 7 rows of data to this stream.
    3. Remember to set the steam to Image AddedStatic.

Snapshot of the Channel Package Check model so far:

Image Added

Combine Data Sets

  1. Create a new stream in your model

...

  1. and populate its attributes.
    1. Hover over CustomerCareUpdates and

...

    1. click Image Modified

...

    1.  Add a new Stream.

...

    1. In the form, set the Name to  Combined Updates

...

    1. .
    2. In the model, show the stream attributes for CustomerCareUpdates .
    3. Select all the attributes and drag them into the form for the Combined Updates stream. Drop them into the Attributes section.
  1. Save your model layout.
  2. Connect the ShopUpdates stream to the Combined Updates stream.
    1. Hover over ShopUpdates and

...

    1. click Image Modified

...

    1.  Add a new Connector.

...

    1. Click Combined Updates to link the pipe to the

...

    1. stream.

...

    1. Info

      When you connect streams, PhixFlow automatically adds a reference to the input pipe name. this appears in the attribute expression. To merge this data successfully you must update the attribute expressions to remove the in. prefix.


  1. Fix all the attribute expressions.
    1. Double-click on Combined Updates to open

...

    1. its configuration form

...

  • Update the expression
Code Block
in.CustomerRef

to

Code Block
CustomerRef

 

...

    1. . For each attribute:
    2. In the Attributes section, double-click on an attribute to open its form.
    3. In the form for the attribute, in the Basic Settings section, edit the Expression to remove in. and press Image Added.
      Image Added
  1. In the Combined Updates stream form, press Image Added to save the changes.
  2. Run analysis on Combined Updates.
  3. Check that

...

  1. the

...

  1. stream has:
    • the columns CustomerRef, Sales Date and Package
    • 15 rows
    • all cells have data.
      The stream default view:
      Image Added

Snapshot of the Chanel Package Check model so far:

Image Added


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:

  1. Update the name of the pipe from the stream CustomerCareUpdates

...

  1. .
    1. Double-click on the pipe to open

...

    1. its configuration

...

    1. form.
    2. Update the Name

...

    1. to CC.
    2. Press Image Modified to save your changes.
  1. Update the name of the pipe from ShopUpdates

...

  1. to shop.
  2. Double-click the stream Combined Updates to open

...

  1. its configuration form

...

  1. .
  2. In the Attributes section, add a new attribute and set:
    1.  Name: Source.
    2. Expression :

      Code Block
      if (_pipeName == "CC",
       "Customer Care"
       ,
       "Shop"
       )

...


  1. To make Source the first attribute in the stream

...

  1. , drag it to the top of the attributes list.
  2. Press Image Modified in the main stream configuration form.
  3. Run analysis on Combined Updates.
  4. Check the output data set and make sure that the source has been recorded on each record correctly.