Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
wiki:pivotexample [2014/02/17 15:09] tony |
wiki:pivotexample [2014/02/17 15:17] tony |
||
---|---|---|---|
Line 107: | Line 107: | ||
Next we should tell jqPivotGrid which field is the country field. With this setting we will generate dynamic columns (yDimension).\\ | Next we should tell jqPivotGrid which field is the country field. With this setting we will generate dynamic columns (yDimension).\\ | ||
- | Seen into the source data this is the country field. Now the settings should be: | + | Seen into the source data this is the Country field. Now the settings should be: |
+ | |||
+ | <code javascript> | ||
+ | ... | ||
+ | yDimension : [ | ||
+ | { | ||
+ | dataName: 'Country' | ||
+ | } | ||
+ | ] | ||
+ | </code> | ||
+ | |||
+ | Now the missed part is which fields we should actually summarize? This is achieved with the aggregates option using the fields Price and Quantity. | ||
+ | |||
+ | <code javascript> | ||
+ | aggregates : [ | ||
+ | { | ||
+ | member : 'Price', | ||
+ | aggregator : 'sum', | ||
+ | width:50, | ||
+ | label:'Sum Price' | ||
+ | }, { | ||
+ | member : 'Quantity', | ||
+ | aggregator : 'sum', | ||
+ | width:50, | ||
+ | label:'Sum Qty' | ||
+ | } | ||
+ | ] | ||
+ | </code> | ||