Question:
Can derived columns be used in iDashboards charts?
Issue:
Some charts need to have additional columns built off of existing column data.
Answer:
Derived Columns are available to be configured in charts.
When creating a chart in iDashboards, it is common to assign each of your Y-axes to a column from the data source. Configured in this way, each Y-axis will simply display the data stored in each column. However, some situations may require one or more of your Y-axes to display data that is a result of a calculation performed on data from the data source. To accomplish this, you would configure each of these Y-axes as a Derived Column. Derived columns display data that is derived from other data in the data set and will be the result of a mathematical expression written in JavaScript.
Consider the following example where the X-axis maps to the ‘Product’ column, the Y1-axis maps to the ‘Sales_Previous_Year’ column, and the Y2-axis maps to the ‘Sales_Current_Year’ column.
In addition to displaying the previous year and current year sales figures in your chart, suppose you would like to display the percent increase or decrease in sales from year to year, for each product. This can be accomplished by adding a derived column to the chart in the Y3 position, called ‘Percent Change’, whose values are derived from a calculation performed on Y1 and Y2. The calculation would look like the following JavaScript expression:
(y2 - y1) / y1 * 100;
When the chart is loaded, the server will evaluate the expression for every row in the data set and insert the result in the Y3 column. The resulting data set would show three columns of data. Y1 and Y2 would be the same as previous, but Y3 would now be present with the solution to the expression that was entered as the data for the column. Note the Y3 or "Percent Change" column has “(Expression)” selected for its Data Column. This indicates it is a derived column. When you select “(Expression)” for a Data Column, the Enter Expression window appears. This is where you enter the JavaScript expression that will be used for the Derived Column.
Applies to:
- Eval Cloud
- Private Cloud
- Enterprise + BAM
- X Platform
- Enterprise Suite
Comments
0 comments
Article is closed for comments.