**Editted my answer **
No need for OPEX_Total. Try this:
FROM PM_Tool.OPEX P GROUP BY P.Category as Category SELECT Category, SUM(P.Value) as Total
Does this work?
Also, for creating and trying out OQL’s, and for lots of examples, see the demo-page https://service.mendixcloud.com/p/OQL
Call it from a microflow, just feed it an OQL-boject, containing a valid OQL in the attribute ‘OQL’:
There are two ways for you to solve this:
I would highly recommend #1
I'm trying to use OQL (via "Execute OQL statement" element) if you suggested below. What I need to extract the sum of all "Value" as list (for ListView on the page) from OPEX table filtered by Year and Category.
I’m struggling with getting “Category” (Enumeration) and “Year” (Date and Time) from the persistent Entity “OPEX” to non-persistent Entity “OPEX_Total”. The system gives me an error. “Comment” and “Value” fields are fed without any issue.
The following simple code works:
But when I apply more complex functionality the system crushes. The following code doesn’t work. The syntax might be wrong, but I tried to feed only “Year” or only “Category” with no success:
Where P.Category = P.Category.Vendor_External_Maintenance
There is an issue with your OQL query, kindly use the query as below:
GROUP By category
GROUP By year
GROUP By category, year
Execute these statements from ExcuteOQLStatement action from a microflow. I am showing screenshots below of one of my OQL statements