Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Read in Data Sets from Files

  1. 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

...

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

...

  1. .
    1. Set Name to Customer Care Updates.
    2. Navigate to the directory …\inputData\ChannelPackages\CustomerCareUpdates.
    3. Select the file CustomerCareUpdates.txt

...

    1.   and complete the automatic file collector and stream configuration.
  1. Add another file collector to your model

...

  1. .
    1. Set Name to Shop Updates.
    2. Navigate to the directory …\inputData\ChannelPackages\ShopUpdates.
    3. Select the file ShopUpdates.txt

...

    1.   and complete the automatic file collector and stream configuration.
  1. Run both streams and check that data from the files is loaded into each one

...

  1. .

Combine

...

Data Sets

  1. Create a new stream in your model

...

  1. .
    1. Hover over CustomerCareUpdates and

...

    1. click Image Modified

...

    1.  Add a new Stream.

...

    1. Set the

...

    1. Name to  Combined Updates.
    2. Drag all attributes from CustomerCareUpdates

...

    1. into Combined Updates.

...

  1. Save your model layout.
  2. Add a pipe from the other stream

...

  1. .
    1. Hover over ShopUpdates and

...

    1. click Image Modified

...

    1.  Add a new Connector.

...

    1. Click Combined Updates to link the pipe to the output stream

...

    1. .
  1. Double-click on Combined Updates to open

...

  1. its configuration form

...

  1. 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

...

  1. to remove the in. prefix. Change in.CustomerRef to CustomerRef.
  2. Press Image Modified in the main stream configuration form.
  3. Run analysis on Combined Updates.
  4. Check that you have the correct number of records in this stream when the analysis is complete.
  5. Check the data set you generated

...

  1. 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:

  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.