Parameters (Xparameter)
Xparameter externalizes service parameters and provides the ability to update parameters separately from the service itself. This separation creates an independent version history from the service and also allows you to execute Spark APIs against numerous parameter scenarios more efficiently.
Understand Xparameter terminology
Before we get into the specific mechanics, you should understand these Xparameter terms:
Parameter: Numerical value(s) that describe a characteristic of a calculation model. They are adjustable variables/assumptions that determine the context in which the outputs are calculated against the inputs (e.g. interest rates, inflation rate, tax base and rates, etc.).
Xparameter: A parameter range in a Spark service model that has been namedXparameter_<parameter>. This range is externalized from the service, creating an independent version history. Whenever the values of anXparameterare updated, a new version of theXparameteris created.Parameter set: A JSON file containing all the
Xparameters of the service with the versions defined. The parameter set's version ID, when defined in the Spark service API'srequest_metainforms the Spark engine which versions of theXparameters should be used to run the calculations. This gives users the ability to run a Spark API of a single service version against different parameter scenarios. Whenever a new parameter set is configured, a new parameter set version is generated for it.Compatibility group (
Xparameter): A group ofXparameterversions in which the column numbers and headers are the same. When anXparameter's column numbers or headers are altered in any way, a new compatibility group is created.Compatibility group (parameter set): A group of parameter set versions in which the compatibility groups of every
Xparameterare the same. When the collection ofXparametercompatibility groups in a parameter set version does not exist in any historical versions, then a new compatibility group is created. Every service version is assigned a parameter set compatibility group number based on which compatibility versions are embedded in the Excel file at upload.Default parameter set: The default parameter set is the most recent parameter set version uploaded to Spark within the service version's assigned compatibility group.
Xparameter hierarchy

A service can have multiple compatibility groups.
Service versions and parameter set versions are grouped together by compatibility groups.
This hierarchy defines which service versions are compatible with which parameter set versions based on the compatibility groups.
Compatibility versions
Compatibility versioning X.Y consists of the compatibility group number X and version number Y.
Each service version can be tied to a parameter set compatibility group. With this implementation, it identifies which parameter set versions are compatible with which service versions. The service version's parameter set compatibility group is listed in Version details.
Compatibility versioning for Xparameters
Compatibility group is dependent on the number of columns and the column header values. If the number of columns changes or if any of the headers are renamed, this will cause a change in compatibility group.
Compatibility version is dependent on the existing versions of the
Xparameterwithin a particular compatibility group. With3existing versions of anXparameterwithin the compatibility group1, then the next compatibility version is4.
Compatibility versioning for parameter sets
Compatibility group of a parameter set version is dependent on the collection of compatibility group numbers of the
Xparameterversions contained within it. If the collection of theXparametergroup numbers within a parameter set version does not match that of any historical versions, this will create a new parameter set compatibility group.Compatibility version is dependent on the existing versions of the parameter sets within a particular compatibility group. If there are currently
3versions of a parameter set within the compatibility group1, then the next parameter set version within group1would have the compatibility version4.
Map parameters
Syntax: Xparameter_<parameter>
Select the entire range of your parameter including the headers. Even if you're working with a single cell parameter, you must include a header.
Name the selected range
Xparameter_<parameter>. In the example below the parameter set was defined asXparameter_SingleColumn.Congratulations! You've created an
Xparameter! Once your Excel model is uploaded onto Spark, theXparameterranges that you have defined will automatically be extracted from the service.
Edit parameters
Two methods exist to edit Xparameters:
Method 1: Edit the Xparameter values directly in your Excel file
This method is recommended when:
You want to make changes to not only the values but also the dimensions of the
Xparameter. For example, if you want to add an additional column to anXparameter, you should do so from the service Excel model.You want to edit multiple
Xparameters' values simultaneously.You want to automatically create a parameter set with the updated values of the
Xparameters in your Excel model.
Open the Excel file.
Edit the
Xparameters. If you change the dimensions of theXparameter, make sure to update the named range to reflect the dimension changes.Save the file.
Upload the file onto Spark and create a new service version.
When you upload a file onto Spark with updated values or changes in dimensions in the
Xparameterrange, Spark will detect the change and create new versions of theXparameters that have been edited.If any edits to
Xparameters are detected at upload (edited values or dimension changes), a new parameter set will automatically be configured with the most recent versions of allXparameters.Reverting the values back to be the same as an older version of the
Xparameterwill still create a new version of theXparameter(meaning2or more versions of anXparametercan have identical content).
Method 2: Use backend APIs to edit Xparameters
This method is recommended when:
You want to edit the values of just a single
Xparameter.You want to edit the values of
Xparameters programmatically in code.
The referenced APIs can be found below in the section Backend APIs.
Use API B) to download the latest
Xparameterversion file.Edit the
Xparametervalues (if you want to change the dimensions of theXparameter, please use method 1 of updating anXparameterwritten above).Save the
Xparameterfile.Use API D) to upload the
Xparameterfile back onto Spark.You can now use this version ID to create a new parameter set.
Configure parameter sets
There are two methods of configuring new parameter sets:
Method 1: Configure parameter sets directly from your Excel model
This method is recommended when you're editing Xparameters with the intention of configuring a new parameter set.
Edit any
Xparameters in the Excel model by either creating new versions of theXparameteror returning to previous versions ofXparameter.Once you're happy with the values in all of the
Xparameters in the Excel model, upload it back onto Spark.New versions of
Xparameters will be created if the values/dimensions of theXparameters are different from those in the most recent version of the service. Please note that even if the edited values in anXparameter's cell range are identical to an older version of theXparameter, a new version of theXparameterwill still be created.A new parameter set will be configured with the versions of the
Xparameters found in the Excel model file as long as it's not identical to the most recent version of the parameter set. If an older parameter set version already exists with the same versions of theXparameters, a new version of the parameter set will still be configured.
Method 2: Use backend APIs to configure parameter sets
This method is recommended when you want to create a parameter set programmatically in code.
The referenced APIs can be found below in the section Backend APIs.
Use API A to get the version ID of the latest parameter set.
Use API C to download the latest parameter set file.
Open the file in a code-editor.
Copy and paste the version IDs of the edited
Xparameters into the parameter set file.Save the parameter set file.
Use API D to upload the parameter set file back onto Spark.
Use API G if you want to see the
Xparametervalues that are contained in a parameter set.
Define a parameter set version in the payload
Set up your Spark API request payload. This can be found in the API Tester.
In the
request_meta, add a new key forparameterset_version_id. Depending on where this is added, you may need to add comma separators.Get the version ID of the parameter set version you'd like to use. Details can be found in Backend APIs API F).
Add the parameter set version ID to the value of the
parameterset_version_idfield.
Sample request
Backend APIs
Sample file
Last updated

