12 Exporting data to files

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

  • Set up a file exporter

In this exercise you will create an export of the customer summary report, to a file.

In your Introduction to Modelling analysis model, add a new file exporter:

  1. Hover over the table Customer Summary by Region, and press  File Exporter.
  2. Give the new exporter the Name: Send Customer Summary Report
  3. Click  Apply and Close to save your changes.
  4. You will now see the new file exporter in the model.
  5.  Save your model layout. 

As well as exporting the file to a directory on the PhixFlow server, you will email the file to yourself. Before you set this up, you need to update the user Train with your email address:

  1. Click  User Options from the header menu.
  2. Update the Email Address with your email address.
  3. Click Save User Details to save your changes.

Complete the setup of the file exporter:

  1. Click on the Send Customer Summary Report  File Exporter icon on your model to open its settings.
  2. Toggle Enabled: .
  3. In the field File Name (Expr) enter the value:

    "customerSummaryByRegion.txt"
  4. In the field Output Directory (Expr) enter:

    "customerReports/customerSummaryByRegion"
  5. Toggle Overwrite existing file: .
  6. Toggle Header: .
  7. Go to the Send By Email section, and set the following:
    • Email from: training@PhixFlow.com
      • This is the email account used to send emails from PhixFlow, see Email Account.
    • Subject Expression: "Export of customerSummaryByRegion.txt at " + now()
    • Toggle Attach File: .
    • Message Expression: "Please find file customerSummaryByRegion.txt attached. Generated at " + now()
  8. Go to the User Recipients section and click .
  9. In the New User Notification Rule settings that opens, set:
    1. Email As: To
    2. Click  Apply.
    3. In the Users section, click  Users to open a list of users.
    4. Drag the user Train (the user you are currently logged in as) into the Users section within the User Notification Rule properties panel.
    5. Save and close the notification rule. PhixFlow adds the user to the list of User Recipients.
  10. In the Send Customer Summary Report file exporter settings, click  Apply and Close.

    The pipe to the file exporter is dotted to indicate that it is a Push pipe. When linking a table to a file exporter you must always use a push pipe. This is because you cannot run a file exporter on its own; it must always be driven from a table. Otherwise, it has no data to process

  11. Run analysis on the table Customer Summary by Region.
  12. To check the log messages, click  Administration →  System Console in the top right of your screen and click into Completed Tasks.
  13. The Customer Summary by Region table should show at the top. Click on this to show the Messages in the bottom half of the screen and scroll to the end; you should see messages telling you that a file has been exported.
  14. Check that you have received an email with the file attached.
  15. The file has also been exported to the PhixFlow server.
  16. In the model window, click  Save.