Expand my Community achievements bar.

Model | Expression Builder | sizeOf() the right direction?

Avatar

Level 1

Hello. I'm working towards building an array that consists of fruitName and fruitType count.  Basically the array will be something like

[0] = Oranges, <some number>

[1] = Apples, <some number>

this array will server as a dataProvider for a Fruit Orders PieChart.  (Answers the question, Of all the orders, how many were Apples? Oranges?)

I'm working with the Model's expression builder and could use some advice. I have an entity called "FruitOrders".  FruitOrders contain a property called "fruitType" which is either "Apple" or "Orange".    This entity and property have a corresponding db table and field.

Is it possible to determine the number of Fruit Orders there are for each fruitType utilizing expression builder? What I'm looking for is a count. 
I can get the total number of orders by using sizeOf() from another entity that has a relationship with FruitOrders, but I need this number broken down by fruitType. Any ideas?  Thanks, Nathan

(I'm working the filter angle as well.    I know I can filter and on the client side dump it all into an array and loop through it with a set of conditions but I'm hoping to nail it down in the model. - Thanks )

2 Replies

Avatar

Level 1

Update: I found the answer in the Engineering Support Center sample application,  available at the LiveCycle Developer Center.

http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/UsingSample/WS9c204e5d269b5a7c1adb0d7412882b...

Avatar

Level 1

Update: I found the answer in the Engineering Support Center sample application, available at the LiveCycle Developer Center