Jump to content
  • Spotfire® Analyst Loading Data from a URL or Web Service using Add Data from File


    This article shows a trick for Spotfire Analyst that allows one to load data from a simple URL or Web Service that presents data as a known data file type, e.g. csv, txt, Excel, etc

    Introduction

    In Spotfire® Analyst, there is a little-known trick that allows one to load data from a simple URL or Web Service that presents data as a known data file type, e.g. csv, txt, Excel, etc.  Loading data in this manner is not possible with more complex Web Services, e.g. scenarios in which authentication is required.  For more complex scenarios, one can load data using TIBCO® Data Virtualization or IronPython scripting.  

    Solution

    In order to load the data in this manner, one can open Spotfire Analyst and select File-> Add Data Tables.  In the Add Data Tables dialog, select Add->File:

    addfile_capture.png.d427df9e64322ec60b102c5b0add9b7a.png

    In the Add Data Tables -> Open File dialog, type or paste the URL into the "File name" text box at the bottom of the dialog.  In this example, I created a simple TXT file and put it on my local Web Server so the URL to the file is http://localhost/testdata.txt:
     

    openfile_capture.png.a2332acb17f3b34a8fe537f789097768.png

    After setting the correct URL, then one can click the "Open" button and then the Import Settings dialog appears in which one can select the appropriate delimiter and preview the data to make sure everything is correctly imported:

    import_capture.png.3a3de726d7fab44a1ca5f4686f4b4151.png

    This is just a simple example.  One can search the web for CSV data sets and download some of those as well from websites.  Sometimes the filename extension will not properly come across as ".csv", ".txt", etc. in the file name, and, in those cases, Spotfire may not be able to determine the type of data and could throw an error.  In cases that are still simple, one should be able to add some IronPython code to bring the data in as a TextDataSource after some pre-processing to give the filename a correct extension.

    There are various websites from which one can pull CSV data.  I found various data sets on the US DATA.GOV site - https://catalog.data.gov/dataset - that worked for testing.  


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...