Community
Participate
Working Groups
Description: Add a Total.count() or Total.countDistinct() function on Value(Y) Series, error pop up when preview in layout. Steps to reproduce: 1.Get the attached flat file as datasource, and open the attached design file. 2.There is a bar chart in the attached design file, set the "Optional Y Series Grouping" as row["component"], bind Value(Y) Series with "Total.countDistinct(row["bug_id"],null,1)", and set Category (X) Series as "row["component"]". 3.Preview in the dssigner, error pop up.
Created attachment 36712 [details] Design file
Created attachment 36713 [details] flat file datasource
We need to remove Total from the expression builder inside the Chart, as it is not supported by the charting engine, nor report engine.
If DtE adds a scriptable objects for Total and engine adds them to the report scripting scope, can chart run this expression in that scripting scope that engine passes to Chart?
Yes, however the scripting scope is not passed to the chart. The engine provides IRowSet.evaluate(String) method to evaluate javascript expressions, which is used by the chart engine. If this IRowSet can evaluate the Total function, then it will work. Please note that the chart is unaware of the meaning of "total" or any other script expression, so setting total won't automatically group the chart series. Also this could possibly cause problems if a user uses Total on a Series and set grouping on the chart to group the series as the data will be aggregated twice: once by the chart engine, once by the report engine. Currently grouping inside the chart is not handled by the DtE but chart engine, so this total function cannot work at the chart grouping level (although it can work on the chart dataset level, which might be useful in some cases). We need to examine if this might not confuse the user.
can we remove the total functions from the expression builder in chart in RC3?
Please disable total in chart expression builder
Added an expression filter to remove Total expression
Resolved.
Since Total has been supported in report engine, chart builder will enable Total function in expression builder since 2.2RC2.
Update of last comments: We will deprecate Total function in all scripts. Users need to define all aggregations using databindings. So Total is still invisible in expression builder.