Hi there,
I have a Value Datasource defined as:
<valueCollectionDatasource id="firstPiechartDs">
<query>
<![CDATA[select p.name, sum(p.amount) from demo$Product p ORDER BY p.createTs]]>
</query>
<properties>
<property datatype="string"
name="entityName"/>
<property datatype="decimal"
name="numValue"/>
</properties>
</valueCollectionDatasource>
While this query works fine in pdAdmin:
SELECT name, SUM(qty * cost) AS inventoryCost FROM public.demo_product GROUP BY name order by inventoryCost DESC;
It failed in a web gui controller:
queryStr = "select p.name, SUM(p.qty * p.cost) AS inventoryCost from demo$Product p GROUP BY p.name order by inventoryCost DESC";
with the following error:
JpqlSyntaxException: Errors found for input jpql:[select p.name, SUM(p.qty * p.cost) AS inventoryCost from demo$Product p GROUP BY p.name order by inventoryCost DESC]
CommonErrorNode [<unexpected: [@8,18:18='(',<23>,1:18], resync=SUM(>]
CommonErrorNode [<mismatched token: [@10,20:20='.',<62>,1:20], resync=.qty * p.cost) AS inventoryCost from demo$Product p>]
Is this caused by Cuba has not implemented the aggregation of arithmetic of multiple columns yet?
Any help is much appreciated.
Thanks,
-Mike