Skip to main content
Skip table of contents

SiStat Batch process

What will you learn

  1. How to get data from the SiStat web page.

  2. How to delete a table from a database

  3. How to insert a table from a process into a database


Prerequisites

  • Access to NetiLab application with sufficient permissions.

  • Corresponding configuration table in database

  • Basic knowladge of NetFlow module


Introduction

The process consists of seven nodes:

  1. Get Config - The node type is SQL Query. This node retrieves information, with the entered sql query, from the configuration table.

  2. Get SiStat Data Batch - The node type is PX Reader Batch Node. This node retrieves information from the SiStat website.

  3. Drop Table - The node type is SQL Query. This node deletes a table, with the entered sql query, from the database.

  4. Import Table - The node type is SQL Bulk Import . This node inserts a table into the database.


Steps

Steps

For illustrative purposes, in the following steps we will use data from two datasets that exist in the configuration table.

Step 1 : Get Config

Open Get Config - node type(SQL Query ) and configure it as:

JSON
{
  "connection": "<results>",
  "Timeout": 90,
  "ResultName": "sistatconfig",
  "queries": [
    "select * from sistatconfig"
  ]
}

The configuration table must exist in the database!


Step 2: Get SiStat Data

Open Get SiStat Data - node type( SiStat process ) and configure it as:

JSON
{
  "Parameters": [
    {
      "Url": "https://pxweb.stat.si:443/SiStatData/api/v1/sl/Data/0762003S.px",
      "TableName": "delovnoSposobni"
    },
    {
      "Url": "https://pxweb.stat.si:443/SiStatData/api/v1/sl/Data/0762003S.px",
      "TableName": "dodanaVrednost"
    }
  ]
}

These properties are from the configuration table.


Step 3: Drop Tables

Open Drop Tables - node type(SQL Query ) and configure it as:

JSON
{
    "connection": "<results>",
    "Timeout": 90,
    "ResultName": "QueryResult",
    "queries": [
        "DROP TABLE IF EXISTS [dbo].[SiStatDelovnoSposobni];\nDROP TABLE IF EXISTS [dbo].[SiStatDodanaVrednost];\n"
}


Step 4: Import Tables

Open Import Tables - node type ( Bulk Insert Multiple ) and configure it as:

JSON
{
    "Conection": "<results>",
    "addColumns": false,
    "MissingTable": false,
    "TableUploads": [
        {
            "TableName": "delovnoSposobni",
            "ServerName": "SiStatDelovnoSposobni",
            "id": null,
            "IncludedColumns": []
        },
        {
            "TableName": "dodanaVrednost",
            "ServerName": "SiStatDodanaVrednost",
            "id": null,
            "IncludedColumns": []
        }
    ]
}


Recommended documentation

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.