Versions Compared

Key

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

Insert excerpt
_Banners
_Banners
nameanalysis
nopaneltrue

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

...

  • Collect data from additional tabs in Excel Spreadsheets

...

Table of Contents

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.  

Upload data using a file collector

...

  • Create a new model Read Account History
  • Drag Image Removed - Add a new File Collector onto the modelling pane menu
  • Call the new file collector Read Account History
  • Hover over your new File Collector, and press Image Removed
  • In the file explorer, go to: …\inputData\AccountTransactions
  • Select the file AccountTransactions.xlsx and press Open
  • In the Upload Managed File form, press Image Removed

You have already learned how to upload data using a file collector in 3 Combining Data Sets. By default the file collector

...

reads from the first sheet in the workbook

...

. The table that PhixFlow creates when you upload the data is configured to hold this data.

...

For this exercise, you need the data from the second worksheet. You will need

...

  • Permanently delete the generated Stream ReadAccountHistory
  • Open the configuration form for the file collector by double-clicking the icon on your modelling pane
  • Go to the Advanced tab
  • In the field Excel Data Expression enter: "accountHistory!A1:F100"
  • Press Image Removed - Apply
  • Go to the File Columns tab
  • Delete the attributes that have been automatically created (these reflect the data in the first sheet in the workbook)
  • Move to the File Columns tab
    • Press Image Removed - Create the file attributes automatically from the header row in the file

CenterView will read the file and work out the attributes that make up the file. You will see these attributes appear in the Attributes list

...

to set additional options to configure PhixFlow to use this sheet.

The easiest way to do this is to load the data from the first sheet, then edit the collector properties.

  1. Create a new model called Read Account History.

    Expand
    titleHow?
    1. Use the
      Insert excerpt
      _addIcon
      _addIcon
      nopaneltrue
      button on the Analysis home screen.
    2. Enter the name Read Account History.
    3. PhixFlow displays the empty model window in the workspace on the left and opens the model's property tab on the right.


  2. Add a file collector and set Basic Settings → Name: LoadAccountHistory.

    Expand
    titleHow?
    1. From the model toolbar, drag a 
      Insert excerpt
      _file_collector
      _file_collector
      nopaneltrue
       into the model.
    2. PhixFlow displays the property tab for the new file collector.


  3. In the property tab toolbar, click 

    Insert excerpt
    _save
    _save
    nopaneltrue
    .

  4. Upload the data.

    Expand
    titleHow?
    1. 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
      nopaneltrue
      .
    2.  Navigate to the directory <path>\train\inputData\AccountTransactions\AccountTransactions.xlsx.
    3. Select the file AccountTransactions.xlsx and click Open, then click
      Insert excerpt
      _upload_button
      _upload_button
      nopaneltrue
      .


  5. On the pop-up box, under Select a WorkSheet, choose accountHistory.
  6. PhixFlow adds a new table to the model, called LoadAccountHistory.

Change the file collector

  1. Double-click the file collector LoadAccountHistory to open its property tab. Set Advanced → Excel Data Range Expression"accountHistory!A1:F100"
  2. Run analysis on the table and confirm that the data that has been read into

...

  1. PhixFlow is from the second tab in the spreadsheet.
  2. In the model window, click 
    Insert excerpt
    _save_saveModel
    _save_saveModel
    nopaneltrue
    .