Sub Query esq

Hello Community!

I have a query with aggregation SUM in products. But need SUMa field depend of the category.

How can make a subquery to sum based a condition 

Regards,

 

				esq.addAggregationSchemaColumn("[Product:OrderProduct:Order].UsrCost",
						this.Terrasoft.AggregationType.SUM, "ProductCost");
				esq.addAggregationSchemaColumn("[Product:OrderProduct:Order].UsrProfit",
						this.Terrasoft.AggregationType.SUM, "ProductProfit");
 
//Only if category of product is xxxxx sum the price
				esq.addAggregationSchemaColumn("[Product:OrderProduct:Order].UsrPrice",
						this.Terrasoft.AggregationType.SUM, "ProductProfit");

 

Like 0

Like

1 comments

Hello Federico,

Unfortunately, there is no way to create a complex query with subqueries via client ESQ.

You can create a business-process that will perform the request to the database, fetch all needed data, process it and display on the page.

Show all comments