Versions Compared
Version | Old Version 16 | New Version Current |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
By the end of this chapter you will be able to:
...
Table of Contents |
---|
You will also learn how to use an 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. The files contain updates from the two sources: the customer care
...
system and the shop.
<path>\train\inputData\ChannelPackages\CustomerCareUpdates\CustomerCareUpdates.txt
<path>\train\inputData\ChannelPackages\ShopUpdates\ShopUpdates.txt
- Create a new model with the
...
- Name,
Channel Package Check
. - Add a file collector to your model and load the data as follows:
- From the model toolbar, drag a
into the model.Insert excerpt _file_collector _file_collector nopanel true - PhixFlow displays
- From the model toolbar, drag a
...
- the settings tab for the new file collector. Set the Name to
Customer Care Updates
. - In the model, hover your mouse pointer over the
- the settings tab for the new file collector. Set the Name to
...
-
Customer Care Updates
file collector to display the context toolbar
-
...
- and click
.Insert excerpt _upload_file _upload_file nopanel true - Navigate to the directory
<path>\train\inputData\ChannelPackages\CustomerCareUpdates
. - Select the file
CustomerCareUpdates.txt
- and click
...
- , click Open, then click
.Insert excerpt _upload_file _upload_file nopanel true - PhixFlow adds a new
- , click Open, then click
...
- table to the model, called
CustomerCareUpdates
. - In the model, hover over the new
CustomerCareUpdates
- table to the model, called
...
- table and click
Insert excerpt _run_analysis _run_analysis nopanel true - Check the data is loaded. There should be 8 lines of data, with columns for Customer Ref, Sales Date and Package.
- Now the data is loaded into the table, set the table to
.Insert excerpt _static _static nopanel true
- table and click
- Add another file collector to your model and repeat the process described
...
- above, this time:
- Set the file collector Name to
Shop Updates
. - Upload
<path>\train\inputData\ChannelPackages\ShopUpdates\ShopUpdates.txt
. - PhixFlow loads 7 rows of data to this
- Set the file collector Name to
...
- table.
- Remember to set the table to
.Insert excerpt _static _static nopanel true
Screenshot of the Channel Package Check
model so far:
...
Image Added
Combine
...
the data sets
- Create a new
...
- table in your model and populate its attributes
...
- :
- Hover over the
CustomerCareUpdates
table and click
- Hover over the
...
.Insert excerpt _table_new _table_new nopanel true - In the
...
- settings, set the Name to
Combined Updates
. - In the model, show the
- settings, set the Name to
...
- table attributes for
CustomerCareUpdates
. - Select all the attributes and drag them into the
- table attributes for
...
- properties for the
Combined Updates
- properties for the
...
- table. Drop them into the Attributes section.
- Click
.Insert excerpt _finish _finish nopanel true
...
- To save your model, in the model toolbar click
.Insert excerpt _save_saveModel _save_saveModel nopanel true - Connect the
ShopUpdates
...
- table to the
Combined Updates
...
- table:
- Hover over
ShopUpdates
and click
- Hover over
...
.Insert excerpt _pipe _pipe nopanel true Click
Combined Updates
to link the pipe to the
...
table.
Info When
...
you connect tables, 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; see step 4 below.
- Fix all the attribute expressions.
- Double-click on
Combined Updates
to open its
- Double-click on
...
- settings tab. For each attribute:
- In the Attributes section, double-click on an attribute to open its
...
- settings.
- In the
...
- Basic Settings section, edit the Expression to remove
in.
and
- Basic Settings section, edit the Expression to remove
...
- click
Insert excerpt _finish _finish nopanel true
Image Added
- click
- In the
Combined Updates
...
- table settings tab, click
to save and close.Insert excerpt _finish _finish nopanel true - In the model, hover your mouse pointer over
Combined Updates
and click
.Insert excerpt _run_analysis _run_analysis nopanel true - When the table has run, check that the table has:
- the columns Customer Ref, Sales Date and Package
- 15 rows
- all cells have data.
The default view:
Image Added
Tip | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
To count the number of rows on a view, select
|
Record the source for each update
You will now update your
...
settings to record the source for each update, in the set of combined updates. To do this:
...
- To update the name of the pipe from the
...
CustomerCareUpdates
table to theCombined Updates
table:- In the model, click on the pipe to open
...
- its settings tab.
...
- Set Name to
CC
.
- Set Name to
...
- Click
to save and close the pipe settings.Insert excerpt _finish _finish nopanel true
- Click
- Repeat the above steps to name the pipe from the
ShopUpdates
table to theCombined Updates
table, shop. - Double-click the
...
- table
Combined Updates
to open
...
- its settings tab.
- In the Attributes section,
...
- click
add a new attribute and set:Insert excerpt _new _new nopanel true
...
- Name:
Source
. Expression
- Name:
...
:
Code Block if (_pipeName == "CC", "Customer Care" , "Shop" )
- Click
to save and close the attribute settings.Insert excerpt _finish _finish nopanel true
- To make
Source
the first attribute in the
...
- table, drag it to the top of the attributes list.
...
- Click
to save and close the table settings.Insert excerpt _finish _finish nopanel true - Run analysis on
Combined Updates
. - In the model window, click
.Insert excerpt _save_saveModel _save_saveModel nopanel true - Check the output data set and make sure that the source has been recorded on each record correctly.
Image Added
Snapshot of the Chanel Package Check model so far:
Image Added