Extracting data from Web Files

Often, the data required for the purpose of reporting is not stored in a database, but instead needs to be fetched from a website. For example, customer location information specifically the geographic co-ordinates used in mapping analysis is not available internally within an organization. This information may be available on the web and can be extracted from there.

Getting ready…

When extracting the data from a web file:

  1. Open an existing Qlik Sense application or create a new one.
  2. Open the data load editor.
  3. Click on Create New Connection and select Web file.
  4. The Select web file window will open.
  5. Insert the following URL from which you can fetch the data:
    http://www.csgnetwork.com/llinfotable.html
  6. Name the connection as QlikSense Cookbook Webfile, as shown:
    Getting ready…

How to do it…

  1. In the list under Data Connections, select QlikSense Cookbook Webfile and click on Select Data. This will open up a preview window listing out all the tables from the web page. When you carefully examine the table contents, you realize that it is the second table @2 that contains the location information.
  2. Check the box next to @2 and ensure that it is selected, so the correct table is shown in the preview. The user will need to change the value under Field names to embedded field names.
  3. The preview of the table will look like the following screenshot:
    How to do it…
  4. Select all the fields from the table in the preview window. Click on Insert script to load the web data in the application.
  5. Name the table as Country_Location and the script will read as follows:
    Country_Location:
    LOAD
    Country,
    Capital,
    Latitude,
    Longitude
    FROM [lib://QlikSense Cookbook Webfile]
    (html, codepage is 1252, embedded labels, table is @2);
  6. Save and load the data. Once the script is successfully loaded, the data model viewer will show the loaded table.

How it works…

Qlik Sense connects to the web file using the stored data connection. Once connected it identifies the tables in the HTML source and lists them in the preview window.

Certain external websites require authentication in order to be accessed and Qlik Sense is unable to cope with websites that are secured in this manner. In order to get over this issue, we can use a third party data extraction tool. The extracted data can be stored in a data file, such as a qvd. The qvd file can then be used as a data source in the Qlik Sense application.

There's more…

Qlik Sense can also extract data from other data formats, such as XML. The underlying principles remain the same as explained in the preceding recipes.

See also…

  • Creating a Master Library from the Data model viewer
  • Activating the Legacy Mode in Qlik Sense® desktop
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset