Category / Section
How to enable the threshold through code view mode in Bold BI
Published:
Please follow these steps to enable the threshold in Bold BI.
- Connect to a data source by providing valid credentials.
- Drag and drop the table from the table schema onto the data design view page.
- By default, the data design view opens with design view. Switch to the code view by enabling the slider option in the tools pane in data design view as shown (highlighted) in the following image.
- This will open the query editor window as shown below,
-
In the Query Editor window, you can write your own query to access table schema information and create a new data source that can be bound to dashboard widgets.
-
Click on the Threshold icon as shown in the following image.
- The threshold dialog box will display after clicking the threshold icon,
how-to-enable-the-threshold-feature-through-code-view-mode-in-datasources 6. You must first select the Threshold checkbox. 7. Then, the Threshold Data Limit input box will be enabled. Please enter the Threshold Data Limit value now.
- After writing your query, click the
Execute
button in the tools pane. You can also view the data for your query at the bottom of the Query Editor by clickingUpdate
.
Then click Save to save the data source.
How to connect BoldBI to a code view mode data source with a threshold via REST API.
Prerequisites
Refer the documentation Rest API - v4.0 for information pertaining to the REST API.
Modes
Only the live mode code view data source with thresholds can be created and edited through the REST API.
Parameters for creating code view mode data source with threshold
Parameters | Details |
---|---|
Servername required |
string Server name or Host name of the connection |
Port required |
string Port number used to connect to data source |
Username required |
string A valid Username for the connection. |
Password required |
string A valid Password for the connection |
Database required |
string database which needs to be connected |
Query required |
string Enter a valid Query |
AdvancedSettings optional |
string Additional optional connection parameters can be provided. By default, it is empty. |
CommandTimeout optional |
string Enter a valid Timeout for connection. By default, it is 300 |
IsSshConnection optional |
boolean Enable or disable SSH. By default, it is false. |
SshServerName optional |
integer Enter a valid Ssh Port number. |
SshUserName optional |
string Enter a valid Ssh Username. By default, it is empty. |
SshPassword optional |
string Enter a valid Ssh Password. By default, it is empty. |
Expressions optional |
Array of Objects |
ThresHold required |
boolean Enable or disable ThresHold. By default, it is false. |
ThresHoldDataLimitValue required |
integer Enter the Threshold Data Limit value. |
For creating code view mode connection with threshold
{
"Name": "string",
"Type": "string",
"Description": "string",
"Connection":
{
"Servername": "string",
"Port": "string",
"Username": "string",
"Password": "string",
"Database": "string",
"Query": "string",
"AdvancedSettings": "string",
"CommandTimeout": "string",
"IsSshConnection": "false",
"SshServerName": "string",
"SshPort": 0,
"SshUsername": "string",
"SshPassword": "string",
"Expressions" :
[{
"Name": "Expression1",
"Expression" : "SUM(numeric expression)"
},
{
"Name": "Expression2",
"Expression" : "UPPER(string expression)"
}],
"ThresHold": "boolean",
"ThresHoldDataLimitValue": "int",
}
}
Example
{
"Name": "Threshold data source",
"Type": "SQL",
"Description": "threshold",
"Connection":
{
"Servername": "localhost",
"Port": "1234",
"Username": "ZZZ",
"Password": "YYY",
"Database": "AdventureWorks2017",
"Query": "SELECT [SalesOrderDetail].[SalesOrderID] AS [SalesOrderID] FROM [Sales].[SalesOrderDetail] AS [SalesOrderDetail]",
"CommandTimeout": "300",
"ThresHold": true,
"ThresHoldDataLimitValue": "500"
}
}
For editing code view mode connection with threshold
{
"Name": "string",
"Type": "string",
"Description": "string",
"DataSourceId": "string",
"Connection":
{
"Servername": "string",
"Port": "string",
"Username": "string",
"Password": "string",
"Database": "string",
"Query": "string",
"AdvancedSettings": "string",
"CommandTimeout": "string",
"IsSshConnection": "false",
"SshServerName": "string",
"SshPort": 0,
"SshUsername": "string",
"SshPassword": "string",
"Expressions" :
[{
"Name": "Expression1",
"Expression" : "SUM(numeric expression)"
},
{
"Name": "Expression2",
"Expression" : "UPPER(string expression)"
}],
"ThresHold": "boolean",
"ThresHoldDataLimitValue": "int",
}
}
Example
{
"Name": "stringthresholdone",
"Type": "SQL",
"Description": "stringdesc",
"DataSourceId":"6a8f300b-c6cc-407b-a2acf1ef",
"Connection": {
"Servername": "localhost",
"Username": "ZZZ",
"Password": "YYY",
"Database": "AdventureWorks2017",
"Query": "SELECT * FROM [Sales].[SalesOrderDetail] AS [SalesOrderDetail]",
"CommandTimeout": "string",
"ThresHold": true,
"ThresHoldDataLimitValue": "1000"
}
}
Limitation
If the threshold limit is set to 5000 and a query returns more than 5000 rows, a warning message will be displayed to the user as shown below.