Import an XML file

Concept Information

IMPORT XML command

You can create an Analytics table by defining and importing an XML file. The Data Definition Wizard allows you to select the XML elements to import, configure the structure of the resulting Analytics table, and customize column headings and data types for the elements you are importing.

Note

In some cases, you may need to adjust one or more field definitions in the resulting Analytics table so that the data displayed in the view accurately reflects the data in the source XML file. You adjust field definitions in the Analytics table layout.

Analytics imports the exact raw data contained in an XML file, and you can see this source data in the table layout. On occasion, a field definition created during the table definition and import process misinterprets the source data, and the definition requires subsequent adjustment. For example, a numeric field could be misinterpreted as a date field, and dates rather than numbers may initially appear in the view.

  1. Select File > New > Table.
  2. If the Select Platform for Data Source page is displayed, select Local and click Next.
  3. In the Select Local Data Source page, select File and click Next.
  4. In the Select File to Define dialog box, locate and select the XML file you want to create the Analytics table from and click Open.

    XML files have a .xml file extension.

  5. In the File Format page, verify that the XML file option has been selected and click Next.
  6. In the Select XML Data Structures page, select one or more XML data structures to include in the resulting Analytics table:
    1. To select a data structure, click the name of the associated XML element.
    2. Click Add to add the data structure to the Preview pane.

      Note

      Generating a preview of the data in a large XML file can be slow, so the Auto Preview option is automatically deselected for XML files larger than 2 GB.

    3. Select and add all the data structures you want to include in the Analytics table.
    4. If necessary, select a data structure in the Preview pane and click Remove to remove it.
    5. Click Next.

    An XML data structure is a collection of XML elements and attributes. For more information, see Selecting XML data structures.

  7. In the Select XML Elements page, fine-tune the selection of XML elements and attributes and click Next.

    For more information, see Selecting and configuring XML elements.

  8. In the Preview Data page, modify the name or properties for any field, if necessary.

    To modify field properties, select the appropriate column heading in the preview table, in the bottom half of the page, and update any of the following properties:

    Name – Keep the name assigned by Analytics for the field in the table layout, or enter a different name.

    Column Title – Enter the column title to display in the default Analytics view. If a column title is not specified the Name value is used.

    Type – Select the appropriate data type from the drop-down list. For information about the supported data types in Analytics, see Data types in Analytics.

    The Decimal and Input text boxes appear automatically when you select the corresponding data type.

    Value – A read-only property that displays the first value in the field. The value is updated based on any edits you make.

    Decimal (numeric fields only) – Specify the appropriate number of decimal places.

    Input (datetime fields only) – Specify the format that matches the data. For more information about date and time formats, see Formats of date and time source data.

  9. Click Next.
  10. In the Save Data File As dialog box, enter a name for the Analytics data file, and if necessary modify the location where the file will be saved, and click Save.
  11. In the Final page, verify the settings for the new Analytics table and click Finish.
  12. Enter a name for the Analytics table you are adding to the project, or keep the default name, and click OK.
  13. Review the data in the new Analytics table and update any field definitions, if required.

    If a field has the wrong data type specified, the data may not appear in the view, or the data may be misinterpreted. For example, a numeric value may be interpreted as a date.

  14. To update a field definition, do the following:
    1. Select Edit > Table Layout.
    2. In the Edit Fields/Expressions tab, double-click the field you want to modify.
    3. Make the necessary changes to the field definition and click Accept Entry .

      For example, you may need to change the Type from Datetime to Numeric.