Adding Grand Total to the database query

How to add Grand Total in the last row from my query? I tried Rollup but its not working, is there any idea? Thanks.
Reference: Sample Output
image
Reference: Sample Querry


Reference: Database

You could add a union with another query that just calculates the sum. Whenever you do calculations like these, there are always columns you can’t just sum (like the months, or percentage), so defining your own query seems to be the only option.

https://dev.mysql.com/doc/refman/5.7/en/union.html

Any other idea or alternative way on how to add total in a table or power table?
Reference:

Thank you.

In a general sense, if you have a dataset that provides all the data you need, but not in the format desired, the answer is to move the binding to another property (custom property) and use a propertyChange event to transform the dataset in a script, writing the result to the original target property. In your case, you’d probably want to compute your sum and then generate the new dataset with system.dataset.addRow().

1 Like