Exporting to a File

Overview

PhixFlow can export data to Excel, CSV and HTML automatically as part of an analysis model. We just need to specify the type of output we would like and what data to use.

Example

In this example we will send Invoice Stats data to a CSV file and place this on our server.

You will need a table that holds your data, we will use a table called Invoice Stats

Solution  

  1. Place your mouse over the Invoice Stats and from the popup menu select  File Exporter.
  2. A file exporter is automatically created, a push pipe is added and its properties open on the right.
  3. Complete the Basic Settings:
    1. Provide a useful Name, for example Export Invoice Stats.
    2. Tick Enabled. This enables the file to be exported. Typically this is only unticked during testing to avoid generating lots of data.
    3. File Name is the name the exported file will be given, it is an expression field. The file extension should match the type of data being exported.
      • For static text, simply encapsulate the desired text in quotes, such as "Stats.csv".
      • For dynamic text use an expression to generate a name, such as:
        "Stats_"+today()+".csv", which will provide the file name Stats_20200419.csv. The expression must return a string.
    4. Output Directory determines where the file will be placed inside the export directory on the server, unless Ignore Base Directory is ticked. More information on the settings can be found in File Exporter. This is also an expression.
    5. Export File as set to Comma Separated Values.
    6. Set the CSV properties:
      • Line Separator Style, select the desired format. Typically this is Windows.
      • Column Separator, select the delimiter for your records. Typically Comma.
      • Quote Style, this defines the quotes used to encapsulate the values in each column. Typically this is Double Quotes.
    7. Overwrite existing file can be ticked if you always want to overwrite files that have the same name. For example, if you only require one Stats.csv file on the server at any one time.
    8. Header is ticked so the output file has column headers.
  4. Your completed properties will look similar to the following:
  5. Click  OK to save your changes.
  6. Run analysis on Invoice Stats and the data will be sent down the push pipe to the exporter and a file will be produced on the server. The location of the export directory is specified in Administration Menu → System → Configuration. 

Sending Files By Email

You can send files  to recipients using a file exporter in an analysis model; see File Exporter.