#Dynamic reporting
In order to explain this feature, let us start with an example. First we are creating the a simple index. The one thing to notice is that we are explicitly setting the Sort
mode for Total to be Double
.
Now we are going to Query > Reporting:
And then we can start issue reporting queries:
This is the equivalent of doing:
{CODE-START:csharp /} select EmployeeID, sum(tot.Total) Total from Orders o join ( select sum((Quantity * UnitPrice) * (1- Discount)) Total, OrderId from [Order Details] group by OrderID ) tot on o.OrderID = tot.OrderID where o.CustomerID = @CustomerId group by EmployeeID {CODE-END /}
The nice thing about this, and what makes this feature different from standard map/reduce, is that you can filter the input data into the aggregation. In code, this would look something like this:
{CODE query@Studio\DynamicReporting.cs /}
This reporting availability takes advantage of the dynamic aggregation feature.