Aggregation on SQL Source does not always work
There is a disconnect between the outputted field name and internal select alias for aggregate fields on SQL Table data sources. I believe this also affects sorting by an aggregated field via clicking the heading on the "Search / Report" output.
Steps to reproduce
- Create data processor
- Add a SQL Table source (I am using a view, but I do not believe it matters)
- Add raw field value with "Aggregate on this field" checked
- Add a field to aggregate
- Add a search output
Expected result
Aggregated field is run through aggregation function producing a result.
Actual result
The aggregated value is always zero.
Work around
Change system name on aggregated field from default
to a concatenation of table_aliasfield_alias. For example if the table is "sql_table" and the column name is "time_completed", use "sql_tabletime_completed".
Other Issues
I do no believe this is related to #54 as the setup is a bit different.