Data Blending

Data blending is required when you are going to use more than one data source column in a widget. Data blending can be performed on the common columns present in the table. So, it has the capability to put accurate actionable data.

For example, consider the following two data sources.

Data source1 contains Table A

Employee_Id Employee_Name Lead_Id Stories_Completed
E1 James L1 4
E2 John L2 4
E3 Robert L3 3
E4 Michael L2 5
E5 Smith L1 5
E6 Williams L1 2

Data source2 contains Table B

Lead_Id Lead_Name Month LeaveDays_Count
L1 Charles Jan 3
L2 David Jan 1
L3 Joseph Jan 3
L1 Charles Feb 2
L2 David Feb 4
L3 Joseph Feb 2

If you blend the two data sources based on common column Lead_Id, the Syncfusion Dashboard Designer will return the output in the widget as follows.

Lead_Id Lead_Name SUM(LeaveDays_Count) SUM(Stories_Completed)
L1 Charles 5 11
L2 David 5 9
L3 Joseph 5 3

Adding a relationship

To get the blending result between two data sources, you should set relationship between the two data sources using the Relationship Manager in the Data Source menu.

RelaionshipMenu

NOTE

The Relationship Manager menu is enabled only if you have two data sources with same connection string in SQL connection type.

After you click the Relationship Manager in the Data Source menu, the Relationship Manager window will be opened as follows.

RelationshipManagerWindow

Click New Relation to define your relationship based on the columns present in the data source tables.

AddRelation

In the above screenshot, the data source lists are shown in the Left Data Source and Right Data Source combo boxes. You can choose the data sources for which the relationship is needed. The Left Column shows the columns present in the Left Data Source tables and the Right Column shows the columns present in the Right Data Source tables.

You can add more than one relation if you prefer by clicking the New Relation button.

NewRelation

Click OK to update the Relationship Manager window.

Configuring a widget with blending data

You can configure your widget using the data sources for which blending relationship is applied.

For example, consider the grid widget with two data sources.

Bind the column named Lead_Id, Stories_Completed in the grid widget from Data source1.

RelationshipinWidget

To bind the columns from Data source2 in the grid widget, switch the data source from Data source1 to Data source2.

SwitchDatasource

Now, you can bind the columns from both data sources as follows

BlendinginWidget

Creating multi data source column expression

You can create an expression using two data source columns that have relationship between them.

For example, if you want to create an expression for Data source1 using the columns present in both Data source1 and Data source2, you can create it as shown in the following screenshot.

ExpressionusingBlending

NOTE

The created expression column will be maintained only in the data source, in which the expression is created.

For example, if the Expression1 is created in the Data source1, then the Expression1 will be shown only for Data source1 in the Control Designer page.

BlendingExpressioninWidget

Removing a relationship

You can remove the relationship condition by clicking the Remove relationship button as follows.

RemoveRelationicon

Click OK to update the Relationship Manager window.

NOTE

Removing a relationship from the Relationship Manager will reset your widget in which the blending relationship is used.

NOTE

Removing a relationship from the Relationship Manager will also delete your expression created using the blending relation.