Skip to content
DeclanBuckley edited this page Jan 25, 2021 · 2 revisions

Create.

Create- Details.

Create a PX-file.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Build.Build_API.Create

Parameters: [Object]

Name Type Default Description
MtrCode String The Matrix Code
MtrOfficialFlag String The Matrix Official Flag Code
FrqCode String The Frequency
CprCode String The Copyright Code
FrmType String The Format Type required, e.g. PX, JSON-stat
FrmVersion String The Format Version
Dimension Dimension Dimension object array (see below)

Dimension: [Object]

Name Type Default Description
LngIsoCode String Language ISO Code
MtrTitle String Matrix Title
MtrNote String Notes
Classification Classification Object array Classification objects (see below)
Statistic Statistic Object array Statistic Objects (see below)
Frequency Frequency Object Frequency Object(see below)
StatisticLabel String Label for statistics

Classification: [Object]

Name Type Default Description
ClsCode String Classification Code
ClsValue String Classification Value
ClsGeoUrl String Classification Geo url
Variable Object array Variables (see below)

Variable: [Object]

Name Type Default Description
VrbCode String Variable Code
VrbValue String Variable Value

Statistic: [Object]

Name Type Default Description
SttCode String Statistic Code
SttValue String Statistic Name
SttUnit String Unit of measurement for the data point e.g number, percent, kg
SttDecimal Integer Number of decimal places in the data point

Frequency: [Object]

Name Type Default Description
FrqValue String Statistic Code
Period Object Array List of Period objects (see below)

Period: [Object]

Name Type Default Description
PrdCode String Period Code
PrdValue String Period Name

Example Parameters:

Example Parameters - Details.

{
    "jsonrpc": "2.0",
    "method": "PxStat.Build.Build_API.Create",
    "params": {
        "MtrCode": "TEST",
        "MtrOfficialFlag": true,
        "FrqCode": "TLIST(A1)",
        "CprCode": "CSO",
        "Dimension": [
            {
                "LngIsoCode": "en",
                "MtrTitle": "test title",
                "MtrNote": "My note",
                "Classification": [
                    {
                        "ClsCode": "C02196V04140",
                        "ClsValue": "Region",
                        "ClsGeoUrl": "https://cdn.cso.ie/client/2.0.0/map/en/ie_nuts2.json",
                        "Variable": [
                            {
                                "VrbCode": "IE04",
                                "VrbValue": "Northern and Western"
                            },
                            {
                                "VrbCode": "IE05",
                                "VrbValue": "Southern"
                            },
                            {
                                "VrbCode": "IE06",
                                "VrbValue": "Eastern and Midland"
                            }
                        ]
                    }
                ],
                "Statistic": [
                    {
                        "SttCode": "001",
                        "SttValue": "My stat",
                        "SttUnit": "%",
                        "SttDecimal": "0"
                    }
                ],
                "Frequency": {
                    "FrqValue": "FVAL",
                    "Period": [
                        {
                            "PrdCode": "2018",
                            "PrdValue": "2018"
                        },
                        {
                            "PrdCode": "2019",
                            "PrdValue": "2019"
                        }
                    ]
                },
                "StatisticLabel": "Statistic"
            }
        ]
    },
    "id": "2"
}

Example creating a PX file with two languages:

{
	"jsonrpc": "2.0",
	"method": "PxStat.Build.Build_API.Create",
	"params": {
  "MtrCode": "TESTTABLE",
  "MtrOfficialFlag": true,
  "FrqCode": "TLIST(A1)",
  "CprCode": "CSO",
  "FrmType": "PX",
  "FrmVersion": "2013",
  "Dimension": [
    {
      "LngIsoCode": "en",
      "MtrTitle": "asdf",
      "FrqCode": null,
      "MtrNote": "",
      "Classification": [
        {
          "ClsCode": "c01",
          "ClsValue": "cls one",
          "ClsGeoUrl": "https://cdn.cso.ie/static/map/en/Dublin_Rest_of_Leinster,_Munster_Connacht_and_Ulster_(part_of).json",
          "Variable": [
            {
              "VrbCode": "v01",
              "VrbValue": "vrb one"
            },
            {
              "VrbCode": "v02",
              "VrbValue": "vrb two"
            }
          ]
        },
        {
          "ClsCode": "c02",
          "ClsValue": "cls two",
          "ClsGeoUrl": "https://cdn.cso.ie/static/map/en/Dublin_Rest_of_Leinster,_Munster_Connacht_and_Ulster_(part_of).json",
          "Variable": [
            {
              "VrbCode": "v01",
              "VrbValue": "vrb one"
            },
            {
              "VrbCode": "v02",
              "VrbValue": "vrb two"
            }
          ]
        }
      ],
      "Statistic": [
        {
          "SttCode": "s01",
          "SttValue": "stat1",
          "SttUnit": "number",
          "SttDecimal": "2"
        },
        {
          "SttCode": "s02",
          "SttValue": "stat2",
          "SttUnit": "number",
          "SttDecimal": "2"
        }
      ],
      "Frequency": {
        "FrqValue": "Annual",
        "Period": [
          {
            "PrdCode": "2016",
            "PrdValue": "2016"
          },
          {
            "PrdCode": "2017",
            "PrdValue": "2017"
          }
          
        ]
      },
      "StatisticLabel": "statistic"
    },
    {
      "LngIsoCode": "ga",
      "MtrTitle": "Teidal",
      "FrqCode": null,
      "MtrNote": "",
      "Classification": [
        {
          "ClsCode": "c01",
          "ClsValue": "cls1",
          "ClsGeoUrl": "https://cdn.cso.ie/static/map/en/Dublin_Rest_of_Leinster,_Munster_Connacht_and_Ulster_(part_of).json",
          "Variable": [
            {
              "VrbCode": "v01",
              "VrbValue": "vrb one"
            },
            {
              "VrbCode": "v02",
              "VrbValue": "vrb two"
            }
          ]
        },
        {
          "ClsCode": "c02",
          "ClsValue": "cls two",
          "ClsGeoUrl": "https://cdn.cso.ie/static/map/en/Dublin_Rest_of_Leinster,_Munster_Connacht_and_Ulster_(part_of).json",
          "Variable": [
            {
              "VrbCode": "v01",
              "VrbValue": "vrb one"
            },
            {
              "VrbCode": "v02",
              "VrbValue": "vrb two"
            }
          ]
        }
        
      ],
      "Statistic": [
        {
          "SttCode": "s01",
          "SttValue": "stat1",
          "SttUnit": "uimhir",
          "SttDecimal": "2"
        },
        {
          "SttCode": "s02",
          "SttValue": "stat2",
          "SttUnit": "uimhir",
          "SttDecimal": "2"
        }
      ],
      "Frequency": {
        "FrqValue": "bliantúil",
        "Period": [
          {
            "PrdCode": "2016",
            "PrdValue": "2016"
          },
          {
            "PrdCode": "2017",
            "PrdValue": "2017"
          }
        ]
      },
      "StatisticLabel": "statistic"
    }
  ]
}
}

Return: Px File.

Validation Rules If multiple languages are used in the build then the following must hold true:

  • All dimensions are in the same order for each language.
  • Classification codes are the same for each classification in each language.
  • Within each classification, variable codes are the same for each language and are in the same order in each language.
  • Individual statistics in the statistic dimension have the same statistic code and are in the same order in each language.
  • Individual periods within the time dimension have the same period code and are in the same order in each language.
  • Any language may only be represented once in the request.
  • The default language of the system must be represented in the request.
  • Any chosen language must have already been setup in the system.
  • A format must be supplied and the chosen format and version must be represented in the system.
  • The number of data cells required by these dimensions does not exceed the configured maximum.

Within each language parameter set:

  • Statistic label must not be the same as the Frequency Value.
  • Any statistic code must be unique.
  • Any statistic value must be unique.
  • Any statistic value must not be same as the statistic label.
  • There must be at least one statistic.
  • Any classification code must be unique.
  • Any classification value must be unique.
  • You must have at least one classification.
  • A geo-code in a classification must be a valid url.
  • Any variables in the classification must be unique.
  • There must be at least one period.
  • Any dimension codes must not equal "value" or "unit".

Update.

Update- Details.

Update a px file. New data for a period(s) may be added or data for existing periods may be updated. Other properties may be updated as outlined below.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Build.Build_API.Update

Parameters: [Object]

Name Type Default Description
MtrInput String Px file as a string (Base64 Encoded)
format String "px" or "json"
FrqValueTimeval String Where there is no TIMEVAL in the px file, this indicates which dimension is for time
FrqCodeTimeval String Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf
MtrOfficialFlag boolean Indicates if this is an Official Statistic
CprCode String Copyright code (where it needs to be amended)
MtrCode String Matrix code (where it needs to be amended)
Dimension Array [Object] There will be one dimension per language in the px file
Signature String The output from the validation process - see PxStat.Build.Build_API.Validate

Dimension: [Object]

Name Type Default Description
LngIsoCode String Language ISO Code
MtrTitle String Matrix Title
MtrNote String Notes
Classification Classification Object array Classification objects (see below)
Frequency Frequency Object Frequency Object(see below)
StatisticLabel String Label for statistics

Frequency: [Object]

Name Type Default Description
FrqValue String Statistic Code
Period Object Array List of Period objects (see below)

Period: [Object] . If any of the Data pertains to new periods, then those periods must be described below.

Name Type Default Description
PrdCode String Period Code
PrdValue String Period Name

Classification: [Object]

Name Type Default Description
ClsCode String Classification Code
ClsGeoUrl String Classification Geo url

Data: [Object array] Note - Each item represents an individual data point that is being added/amended. Each data point will have one statistic and one time period and one or more classifications. The number of items in the object will therefore depend on the number of classifications in the matrix.

Name Type Default Description
Statistic Code String The value corresponding to Statistic Code
Frequency Code String The value corresponding to Frequency Code
Classification Code String The variable value corresponding to Classification Code for this data point
Signature String The output from the validation process - see PxStat.Build.Build_API.Validate

The Classification Code entry will be repeated for each Classification in the Matrix.

Example Parameters:

Example Parameters - Details.

 {
        "MtrInput": "data:text/x-pcaxis;base64,Q0hBUlNFVD0iQU5TSSI7DQpBWElTLVZFUlNJT049IjIwMTMiOw0KTEFOR1VBR0U9ImVuIjsNCkNSRUFUSU9OLURBVEU9ILjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "format": "px",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)",
        "MtrOfficialFlag": true,
        "CprCode":"CSO",
        "MtrCode":"SPQ23x",
        "Dimension": [
            {
                "LngIsoCode": "en",
                "MtrTitle": "This is the amended title",
                "MtrNote": "This is a new test note",
                "StatisticLabel": "StatisticXXX",
                "Frequency": {
                    "FrqValue": "3month",
                    "Period": [
                        {
                            "PrdCode": "2013Q3",
                            "PrdValue": "2013Q3en"
                        }
                    ]
                },
                "Classification": [
                    {
                        "ClsCode": "SPSPORT",
                        "ClsGeoUrl": "https://cdn.cso.ie/client/2.0.0/map/en/ie_nuts2.json"
                    },
                    {
                        "ClsCode": "CNJOBS",
                        "ClsGeoUrl": null
                    }
                ]
            }
        ],
        "Data": [
            {
                "STATISTIC": "29797791",
                "CNJOBS": "2",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "02",
                "VALUE": "1.1"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "3",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "02",
                "VALUE": "3.3"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "1",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "03",
                "VALUE": "4.4"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "2",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "03",
                "VALUE": "5.5"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "3",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "03",
                "VALUE": "6.6"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "1",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "04",
                "VALUE": "7.7"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "2",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "04",
                "VALUE": "7.8"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "1",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "02",
                "VALUE": "11.1"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "3",
                "TLIST(Q1)": "2013Q3",
                "SPSPORT": "04",
                "VALUE": "77.9"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "1",
                "TLIST(Q1)": "2013Q2",
                "SPSPORT": "02",
                "VALUE": "11.3"
            },
            {
                "STATISTIC": "29797791",
                "CNJOBS": "3",
                "TLIST(Q1)": "2013Q2",
                "SPSPORT": "04",
                "VALUE": "77.3"
            }
        ]
    }

Return: String with value of success.

Validation Rules

  • Period codes must not be duplicated.
  • Languages must be unique in each dimension parameter.
  • Requested format must be a valid format configured in the system.
  • Any dimension codes must not equal "value" or "unit".
  • The signature field must correspond to the signature returned for a validation of the same px file.

Validations for Data array:

  • Each data object must contain a value.
  • Each data object must contain a statistic.
  • Each data object must contain a period.
  • Each data object must contain a variable for each classification .

Note - These validations will not result in the request being refused. Invalid items in the data array will be ignored and the response report will show them as not updated.


ReadTemplate.

Reads a CSV template to allow the front end to create an array of Data objects (see Update).

Validate Period for Matrix Properties.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Build.Build_API.ReadTemplate

Parameters:

Name Type Default Description
MtrInput String Px file as a string (Base64 Encoded)
FrqValueTimeval String Where there is no TIMEVAL in the px file, this indicates which dimension is for time
FrqCodeTimeval String Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf
Signature String The output from the validation process - see PxStat.Build.Build_API.Validate

Example Parameters:

Example Parameters - Details.

{
    	"MtrInput": "data:text/x-pcaxis;base64,Q0hBUlNFVD0iQU5TSSI7DQpBWElTLVZFUlNJT049IjIwMTMiOw0KTEFOR1VBR0U9ImVuIjsNCkNSRUFUSU9OLURBVEU9IjIwMTkxMDA5IDE1OjQ1IjsNCk9GRklDSUFMLVNUQVRJU1RJQ1M9Ik5PIjsNCkRFQ0lNQUxTPTE7DQpNQVRSSVg9IlNQUTIzIjsNClNVQkpFQ1QtQVJFQT0ibi9hIjsNClNVQkpFQ1QtQ09ERT0iTkEiOw0KREVTQ1JJUFRJT049IlRoaXMgaXMgdGhlIGFtZW5kZWQgdGl0bGUiOw0KVElUTEU9IlBlcnNvbnMgYWdlZCAxNSB5ZWFycyBhbmQgb3ZlciB3aG8gcGFydGljaXBhdGUgaW4gc3BvcnQgYW5kL29yIHBoeXNpY2FsIGFjdGl2aXR5ICglKSAoVHlwZSBvZiBTcG9ydCxQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzKSI7DQpDT05URU5UUz0iUGVyc29ucyBhZ2VkIDE1IHllYXJzIGFuZCBvdmVyIHdobyBwYXJ0aWNpcGF0ZSBpbiBzcG9ydCBhbmQvb3IgcGh5c2ljYWwgYWN0aXZpdHkgKCUpIjsNClVOSVRTPSIlIjsNClNUVUI9IlF1YXJ0ZXIiOw0KSEVBRElORz0iVHlwZSBvZiBTcG9ydCIsIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiOw0KVkFMVUVTKCJRdWFydGVyIik9IjIwMTNRMiIsIjIwMTNRM2VuIjsNClZBTFVFUygiVHlwZSBvZiBTcG9ydCIpPSJTd2ltbWluZyIsIkN5Y2xpbmciLCJBdGhsZXRpY3MiOw0KVkFMVUVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IkF0IHdvcmsiLCJVbmVtcGxveWVkIiwiU3R1ZGVudCI7DQpUSU1FVkFMKCJRdWFydGVyIik9VExJU1QoUTEpLCIyMDEzUTIiLCIyMDEzUTMiOw0KQ09ERVMoIlR5cGUgb2YgU3BvcnQiKT0iMDIiLCIwMyIsIjA0IjsNCkNPREVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IjEiLCIyIiwiMyI7DQpET01BSU4oIlR5cGUgb2YgU3BvcnQiKT0iU1BTUE9SVCI7DQpET01BSU4oIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiKT0iQ05KT0JTIjsNCk1BUCgiVHlwZSBvZiBTcG9ydCIpPSJodHRwczovL2Nkbi5jc28uaWUvY2xpZW50LzIuMC4wL21hcC9lbi9pZV9udXRzMi5qc29uIjsNClNPVVJDRT0iQ2VudHJhbCBTdGF0aXN0aWNzIE9mZmljZSwgSXJlbGFuZCI7DQpOT1RFWD0iVGhpcyBpcyBhIG5ldyB0ZXN0IG5vdGUiOw0KREFUQT0NCjExLjMgMTIuNyA5LjUgMTUuMiAxNS45IDcuMiAxMi4yIDYuMSA3Ny4zIA0KMTEuMSAxLjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)"
    }

Return: CSV Template object.


Read.

Reads a px file as an array of json-stat objects. There will be one json-stat object for each language in the px file.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Build.Build_API.Read

Parameters:

Name Type Default Description
MtrInput String Px file as a string (Base64 Encoded)
FrqValueTimeval String Where there is no TIMEVAL in the px file, this indicates which dimension is for time
FrqCodeTimeval String Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf
Signature String The output from the validation process - see PxStat.Build.Build_API.Validate

Example Parameters:

Example Parameters - Details.

{
    	"MtrInput": "data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YgU3BvcnQiKT0iMDIiLCIwMyIsIjA0IjsNCkNPREVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IjEiLCIyIiwiMyI7DQpET01BSU4oIlR5cGUgb2YgU3BvcnQiKT0iU1BTUE9SVCI7DQpET01BSU4oIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiKT0iQ05KT0JTIjsNCk1BUCgiVHlwZSBvZiBTcG9ydCIpPSJodHRwczovL2Nkbi5jc28uaWUvY2xpZW50LzIuMC4wL21hcC9lbi9pZV9udXRzMi5qc29uIjsNClNPVVJDRT0iQ2VudHJhbCBTdGF0aXN0aWNzIE9mZmljZSwgSXJlbGFuZCI7DQpOT1RFWD0iVGhpcyBpcyBhIG5ldyB0ZXN0IG5vdGUiOw0KREFUQT0NCjExLjMgMTIuNyA5LjUgMTUuMiAxNS45IDcuMiAxMi4yIDYuMSA3Ny4zIA0KMTEuMSAxLjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)"
    }

Return: json-stat array corresponding to the px file.

Validate.

Validates a px file and returns a signature to be used as a validation token for other operations. If the time dimension is not specified in the px file (i.e. in a TIMEVAL), a list of candidate dimension names is returned and the user will choose which of them is to represent the time dimension.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Build.Build_API.Validate

Parameters:

Name Type Default Description
MtrInput String Px file as a string (Base64 Encoded)
FrqValueTimeval String Where there is no TIMEVAL in the px file, this indicates which dimension is for time
FrqCodeTimeval String Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf

Returns:

Name Type Default Description
Signature String Token to indicate that validation was successful
FrqValueCandidate String[] List of candidate dimensions that could serve as a time dimension. The user will choose from this list in the next step

Example Parameters:

Example Parameters - Details.

{
    	"MtrInput": "data:text/x-pcaxis;base64,Q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IiLCIwMyIsIjA0IjsNCkNPREVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IjEiLCIyIiwiMyI7DQpET01BSU4oIlR5cGUgb2YgU3BvcnQiKT0iU1BTUE9SVCI7DQpET01BSU4oIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiKT0iQ05KT0JTIjsNCk1BUCgiVHlwZSBvZiBTcG9ydCIpPSJodHRwczovL2Nkbi5jc28uaWUvY2xpZW50LzIuMC4wL21hcC9lbi9pZV9udXRzMi5qc29uIjsNClNPVVJDRT0iQ2VudHJhbCBTdGF0aXN0aWNzIE9mZmljZSwgSXJlbGFuZCI7DQpOT1RFWD0iVGhpcyBpcyBhIG5ldyB0ZXN0IG5vdGUiOw0KREFUQT0NCjExLjMgMTIuNyA5LjUgMTUuMiAxNS45IDcuMiAxMi4yIDYuMSA3Ny4zIA0KMTEuMSAxLjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)"
    }

ReadDatasetByAllPeriods.

Reads a CSV template to allow the front end to create an array of Data objects (see Update). This template will include all of the dimensions required for the existing periods (with their values) and new periods (with empty data). This enables users to fill in the template with the required values prior to update.

Validate Period for Matrix Properties.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Build.Build_API.ReadDatasetByAllPeriods

Parameters:

Name Type Default Description
MtrInput String Px file as a string (Base64 Encoded)
FrqValueTimeval String Where there is no TIMEVAL in the px file, this indicates which dimension is for time
FrqCodeTimeval String Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf
Signature String The output from the validation process - see PxStat.Build.Build_API.Validate
Dimension Array [Object] There will be one dimension per language in the px file

Dimension: [Object]

Name Type Default Description
LngIsoCode String Language ISO Code
Frequency Frequency Object Frequency Object(see below)

Period: [Object] . If any of the Data pertains to new periods, then those periods must be described below.

Name Type Default Description
PrdCode String Period Code
PrdValue String Period Name

Example Parameters:

Example Parameters - Details.

{
    "jsonrpc": "2.0",
    "method": "PxStat.Build.Build_API.Read",
    "params": {
        "MtrInput": "data:text/x-pcaxis;base64,Q0hBUlNFVD0iQU5TSSI7DQpBWElTLVZFUlNJT049IjIwMTMiOw0KTEFOR1VBR0U9ImVuIjsNCkNSRUFUSU9OLURBVEU9IjIwMTkxMDA5IDE1OjQ1IjsNCk9GRklDSUFMLVNUQVRJU1RJQ1M9Ik5PIjsNCkRFQ0lNQUxTPTE7DQpNQVRSSVg9IlNQUTIzIjsNClNVQkpFQ1QtQVJFQT0ibi9hIjsNClNVQkpFQ1QtQ09ERT0iTkEiOw0KREVTQ1JJUFRJT049IlRoaXMgaXMgdGhlIGFtZW5kZWQgdGl0bGUiOw0KVElUTEU9IlBlcnNvbnMgYWdlZCAxNSB5ZWFycyBhbmQgb3ZlciB3aG8gcGFydGljaXBhdGUgaW4gc3BvcnQgYW5kL29yIHBoeXNpY2FsIGFjdGl2aXR5ICglKSAoVHlwZSBvZiBTcG9ydCxQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzKSI7DQpDT05URU5UUz0iUGVyc29ucyBhZ2VkIDE1IHllYXJzIGFuZCBvdmVyIHdobyBwYXJ0aWNpcGF0ZSBpbiBzcG9ydCBhbmQvb3IgcGh5c2ljYWwgYWN0aXZpdHkgKCUpIjsNClVOSVRTPSIlIjsNClNUVUI9IlF1YXJ0ZXIiOw0KSEVBRElORz0iVHlwZSBvZiBTcG9ydCIsIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiOw0KVkFMVUVTKCJRdWFydGVyIik9IjIwMTNRMiIsIjIwMTNRM2VuIjsNClZBTFVFUygiVHlwZSBvZiBTcG9ydCIpPSJTd2ltbWluZyIsIkN5Y2xpbmciLCJBdGhsZXRpY3MiOw0KVkFMVUVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IkF0IHdvcmsiLCJVbmVtcGxveWVkIiwiU3R1ZGVudCI7DQpUSU1FVkFMKCJRdWFydGVyIik9VExJU1QoUTEpLCIyMDEzUTIiLCIyMDEzUTMiOw0KQ09ERVMoIlR5cGUgb2YgU3BvcnQiKT0iMDIiLCIwMyIsIjA0IjsNCkNPREVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IjEiLCIyIiwiMyI7DQpET01BSU4oIlR5cGUgb2YgU3BvcnQiKT0iU1BTUE9SVCI7DQpET01BSU4oIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiKT0iQ05KT0JTIjsNCk1BUCgiVHlwZSBvZiBTcG9ydCIpPSJodHRwczovL2Nkbi5jc28uaWUvY2xpZW50LzIuMC4wL21hcC9lbi9pZV9udXRzMi5qc29uIjsNClNPVVJDRT0iQ2VudHJhbCBTdGF0aXN0aWNzIE9mZmljZSwgSXJlbGFuZCI7DQpOT1RFWD0iVGhpcyBpcyBhIG5ldyB0ZXN0IG5vdGUiOw0KREFUQT0NCjExLjMgMTIuNyA5LjUgMTUuMiAxNS45IDcuMiAxMi4yIDYuMSA3Ny4zIA0KMTEuMSAxLjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)",
        
        "Signature": "9644d37c8588e901241345eabac16458",
        "Dimension": [
            {
                "LngIsoCode": "en",
                "Frequency": {
                    
                    "Period": [
                        
                        {
                            "PrdCode": "2018Q1",
                            "PrdValue": "2018Q1en"
                        }
                    ]
                }
            }
            
        ]
    },
    "id": "2"
}

**Return:**  CSV Template object.



<hr>

 
## ReadDatasetByNewPeriods.


Reads a CSV template to allow the front end to create an array of Data objects (see Update). This template will include all of the dimensions required for the new periods with empty data. This enables users to fill in the template with the required values prior to update. 


Validate Period for Matrix Properties.

**Authentication:** `Windows` 

**Privilege :** `Administrator` , `Moderator` , `Power User` 

**Method:** `PxStat.Build.Build_API.ReadDatasetByNewPeriods`

**Parameters:**  

| Name | Type | Default | Description  |
| :--- | :--- | :--- | :--- | 
|`MtrInput`  | String  | |Px file as a string (Base64 Encoded)|
|`FrqValueTimeval`  | String  || Where there is no TIMEVAL in the px file, this indicates which dimension is for time|
|`FrqCodeTimeval`  | String || Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf|
|`Signature`  | String  | |The output from the validation process - see PxStat.Build.Build_API.Validate|
|`Dimension`  | Array [Object] || There will be one dimension per language in the px file|


**Dimension:**  [Object]

| Name | Type | Default | Description  |
| :--- | :--- | :--- | :--- | 
|`LngIsoCode`  | String  | |Language ISO Code |
|`Frequency`  | Frequency Object | |Frequency Object(see below) |

**Period:**  [Object] . If any of the Data pertains to new periods, then those periods must be described below.

| Name | Type | Default | Description  |
| :--- | :--- | :--- | :--- | 
|`PrdCode`  | String  | |Period Code |
|`PrdValue`  | String  | |Period Name|


**Example Parameters:**


Example Parameters - Details.


```json
{
    "jsonrpc": "2.0",
    "method": "PxStat.Build.Build_API.Read",
    "params": {
        "MtrInput": "data:text/x-pcaxis;base64,Q0hBUlNFVD0iQU5TSSI7DQpBWElTLVZFUlNJT049IjIwMTMiOw0KTEFOR1VBR0U9ImVuIjsNCkNSRUFUSU9OLURBVEU9IjIwMTkxMDA5IDE1OjQ1IjsNCk9GRklDSUFMLVNUQVRJU1RJQ1M9Ik5PIjsNCkRFQ0lNQUxTPTE7DQpNQVRSSVg9IlNQUTIzIjsNClNVQkpFQ1QtQVJFQT0ibi9hIjsNClNVQkpFQ1QtQ09ERT0iTkEiOw0KREVTQ1JJUFRJT049IlRoaXMgaXMgdGhlIGFtZW5kZWQgdGl0bGUiOw0KVElUTEU9IlBlcnNvbnMgYWdlZCAxNSB5ZWFycyBhbmQgb3ZlciB3aG8gcGFydGljaXBhdGUgaW4gc3BvcnQgYW5kL29yIHBoeXNpY2FsIGFjdGl2aXR5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gMTUuMiAxNS45IDcuMiAxMi4yIDYuMSA3Ny4zIA0KMTEuMSAxLjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)",
        
        "Signature": "9644d37c8588e901241345eabac16458",
        "Dimension": [
            {
                "LngIsoCode": "en",
                "Frequency": {
                    
                    "Period": [
                        
                        {
                            "PrdCode": "2018Q1",
                            "PrdValue": "2018Q1en"
                        }
                    ]
                }
            }
            
        ]
    },
    "id": "2"
}

**Return:**  CSV Template object.



<hr>


## ReadDatasetByExistingPeriods.

Reads a CSV template to allow the front end to create an array of Data objects (see Update). This template will include all of the dimensions required for the existing periods along with their values. 


Validate Period for Matrix Properties

**Authentication:** `Windows` 

**Privilege :** `Administrator` , `Moderator` , `Power User` 

**Method:** `PxStat.Build.Build_API.ReadDatasetByExistingPeriods`

**Parameters:**  

| Name | Type | Default | Description  |
| :--- | :--- | :--- | :--- | 
|`MtrInput`  | String  | |Px file as a string (Base64 Encoded)|
|`FrqValueTimeval`  | String  || Where there is no TIMEVAL in the px file, this indicates which dimension is for time|
|`FrqCodeTimeval`  | String || Where there is no TIMEVAL in the px file, this indicates the Frequency Code. Must conform to TIMEVAL in https://www.scb.se/globalassets/vara-tjanster/px-programmen/px-file_format_specification_2013.pdf|
|`Signature`  | String  | |The output from the validation process - see PxStat.Build.Build_API.Validate|
|`Dimension`  | Array [Object] || There will be one dimension per language in the px file|


**Dimension:**  [Object]

| Name | Type | Default | Description  |
| :--- | :--- | :--- | :--- | 
|`LngIsoCode`  | String  | |Language ISO Code |
|`Frequency`  | Frequency Object | |Frequency Object(see below) |

**Period:**  [Object] . If any of the Data pertains to new periods, then those periods must be described below.

| Name | Type | Default | Description  |
| :--- | :--- | :--- | :--- | 
|`PrdCode`  | String  | |Period Code |
|`PrdValue`  | String  | |Period Name|


**Example Parameters:**


Example Parameters - Details.


```json
{
    "jsonrpc": "2.0",
    "method": "PxStat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DEzUTMiOw0KQ09ERVMoIlR5cGUgb2YgU3BvcnQiKT0iMDIiLCIwMyIsIjA0IjsNCkNPREVTKCJQcmluY2lwYWwgRWNvbm9taWMgU3RhdHVzIik9IjEiLCIyIiwiMyI7DQpET01BSU4oIlR5cGUgb2YgU3BvcnQiKT0iU1BTUE9SVCI7DQpET01BSU4oIlByaW5jaXBhbCBFY29ub21pYyBTdGF0dXMiKT0iQ05KT0JTIjsNCk1BUCgiVHlwZSBvZiBTcG9ydCIpPSJodHRwczovL2Nkbi5jc28uaWUvY2xpZW50LzIuMC4wL21hcC9lbi9pZV9udXRzMi5qc29uIjsNClNPVVJDRT0iQ2VudHJhbCBTdGF0aXN0aWNzIE9mZmljZSwgSXJlbGFuZCI7DQpOT1RFWD0iVGhpcyBpcyBhIG5ldyB0ZXN0IG5vdGUiOw0KREFUQT0NCjExLjMgMTIuNyA5LjUgMTUuMiAxNS45IDcuMiAxMi4yIDYuMSA3Ny4zIA0KMTEuMSAxLjEgMy4zIDQuNCA1LjUgNi42IDcuNyA3LjggNzcuOTs=",
        "FrqValueTimeval": "Quarter",
        "FrqCodeTimeval": "TLIST(Q1)",
        
        "Signature": "9644d37c8588e901241345eabac16458",
        "Dimension": [
            {
                "LngIsoCode": "en",
                "Frequency": {
                    
                    "Period": [
                        
                        {
                            "PrdCode": "2018Q1",
                            "PrdValue": "2018Q1en"
                        }
                    ]
                }
            }
            
        ]
    },
    "id": "2"
}

**Return:**  CSV Template object.



<hr>
Clone this wiki locally