Add an Output Structure to an Aggregate

By João Costa on 27 Jan

Instead of having to use an SQL statement for this:
SELECT {OrderStatus}.[Label], COUNT({Order}.[Id]), '', '' , '' FROM {Order} INNER JOIN {OrderStatus} ON {Order}.[OrderStatusId] = {OrderStatus}.[Id] GROUP BY {OrderStatus}.[Label]

with an output structure of DataPoint for example.

Add the possibility of defining the Output Structure of an Aggregate so it's bind to DataPoint structure directly.  




Why would you need to use an advanced SQL for that? The aggregate can do that, and if the definition matches your DataPoint, you should be able to just ListAppendAll the aggregate results to your DataPointList and it will map it over?

J.Ja

Yes, that would be my approach as well. The mapping possibilities in P10 are great for such things. You wouldn't even need a ListAppendAll, just pass the Aggregate output to whatever action uses a DataPoint List and map it right there.

Thanks for the feedback,

I add this idea because with an aggregate, I was unable to map the data from an entity (e.g. Order) directly to a DataPoint List.

Is it possible to map without a for each loop? If so, how?

BTW Kilian, what "mapping possibilities in P10" exists that we can use for this scenario?

Cheers,

João

Hi Joao,

You just use an assign, and Service Studio asks you how to map. Easy peasy!

Thx Kilian (Y)


Something like this then:

Hi João,

That's indeed what I meant.