This sample demonstrates grouping dates in year, quarter, month, etc., and number types in ranges like 1–5, 6–10, etc. in row and column headers of the pivot table.
1001-1004 | 1005-1008 | 1009-1010 | Grand Total | |||||
---|---|---|---|---|---|---|---|---|
Unit Sold | Sold Amount | Unit Sold | Sold Amount | Unit Sold | Sold Amount | Unit Sold | Sold Amount | |
2015 | 129 | $1,692 | 129 | $2,583 | 45 | $132 | 303 | $4,407 |
2016 | 196 | $1,628 | 92 | $2,524 | 76 | $224 | 364 | $4,376 |
2017 | 86 | $1,128 | 86 | $1,722 | 30 | $88 | 202 | $2,938 |
2018 | 245 | $2,631 | 115 | $4,197 | 95 | $308 | 455 | $7,136 |
Grand Total | 656 | $7,079 | 422 | $11,026 | 246 | $752 | 1,324 | $18,857 |
Group Date by: | |
Group Product ID by: | |
In this sample, the date type can be separated and showcased individually as year, quarter, month, or day by selecting the appropriate option from the Group date by drop-down list. Also, numbers can be grouped by entering the appropriate value in the Group Product ID by giving a range number in the the numeric text box.
Grouping can be applied through code-behind using the groupSettings
object in the pivot table
along with the following properties:
name:
|
Specifies the normal field. |
type:
|
Specifies the field type for applying the group settings. For example, date formatted fields should be in Date type and number formatted fields should be in Number type. |
groupInterval :
|
Specifies the interval for date fields in years, quarters, months, etc. |
rangeInterval :
|
Specifies the interval value to group the number field. |
More information on the grouping can be found in this documentation section.