By the end of this chapter you will be able to:
...
In 2 Using Excel Templates, you downloaded train.zip and saved the files to <path>
. Find this file: <path>\inputData\AccountTransactions\AccountTransactions.xlsx
. The second tab of this workbook – accountHistory contains details of account transactions.
...
Create a new model called
Read Account History.
Expand title How? - In the repository browser, right-click Analysis Models then click
Analysis Model.Insert excerpt _add _add nopanel true - PhixFlow displays the empty model in the modelling pane on the left and opens the model property tab on the right.
- In Basic Settings → Name, enter
Read Account History
.
- In the repository browser, right-click Analysis Models then click
Add a file collector and set Basic Settings → Name:
LoadAccountHistory
.Expand title How? - From the model toolbar, drag a
into the model.Insert excerpt _file_collector _file_collector nopanel true - PhixFlow displays the property tab for the new file collector.
- From the model toolbar, drag a
In the property tab toolbar, click
.Insert excerpt _save _save nopanel true Upload the data.
Expand title How? - In the model, hover your mouse pointer over the
AccountHistory
file collector to display the context toolbar and click
.Insert excerpt _upload_file _upload_file nopanel true - Navigate to the directory
<path>\train\inputData
.\AccountTransactions\AccountTransactions.xlsx
- Select the file
AccountTransactions.xlsx
and click Open, then click
.Insert excerpt _upload_button _upload_button nopanel true
- In the model, hover your mouse pointer over the
- PhixFlow adds a new stream to the model, called
LoadAccountHistory
.
...
- In the model, right-click the new stream and click permenantly delete
- Double-click LoadAccountHistory to open its property tab. Set Advanced → Excel Data Range Expression:
"accountHistory!A1:F100"
- In the File Coluns section, delete the column information that PhixFlow has already loaded.
- Click - Create file attributes
- PhixFlow already knows about the data in the spreadsheet. It now uses the expression you added to read the information about the columns in the second worksheet. PhixFlow adds the attributes to the list.
- In the model view, from the hover menu of the file collector press - Create a new Stream
- Save your changes
- Have a look the attributes in the new stream – you can see that these have been derived from the columns in the file collector
- Run analysis on the stream and confirm that the data that has been read into PhixFlow is from the second tab in the spreadsheet
...