This sample demonstrates how to apply an external date range filter to the Pivot Table data source, enhancing performance and responsiveness when working with large datasets.
Canada | France | Germany | UK | USA | Grand Total | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Laptop | Monitor | Tablet | France Total | Laptop | Monitor | Tablet | Germany Total | Laptop | Monitor | Tablet | UK Total | Laptop | Monitor | Tablet | USA Total | |||
2024 | $18,345 | $6,253 | $6,020 | $6,188 | $18,461 | $6,770 | $7,397 | $6,568 | $20,735 | $8,132 | $7,745 | $7,080 | $22,957 | $4,350 | $6,816 | $5,368 | $16,534 | $97,032 |
Jan | $1,903 | $257 | $860 | $138 | $1,255 | $812 | $1,053 | $124 | $1,989 | $587 | $1,060 | $760 | $2,407 | $125 | $244 | $352 | $721 | $8,275 |
Feb | $1,533 | $443 | $971 | $796 | $2,210 | $429 | $1,065 | $962 | $2,456 | $455 | $1,019 | $399 | $1,873 | $153 | $874 | $201 | $1,228 | $9,300 |
Mar | $1,098 | $741 | $145 | $847 | $1,733 | $388 | $722 | $157 | $1,267 | $1,092 | $360 | $452 | $1,904 | $880 | $290 | $891 | $2,061 | $8,063 |
Apr | $1,943 | $178 | $510 | $525 | $1,213 | $936 | $850 | $200 | $1,986 | $694 | $1,033 | $1,031 | $2,758 | $331 | $535 | $195 | $1,061 | $8,961 |
May | $2,250 | $189 | $137 | $448 | $774 | $840 | $455 | $968 | $2,263 | $676 | $257 | $866 | $1,799 | $151 | $930 | $766 | $1,847 | $8,933 |
Jun | $1,882 | $1,094 | $296 | $717 | $2,107 | $344 | $601 | $591 | $1,536 | $843 | $975 | $1,048 | $2,866 | $241 | $448 | $716 | $1,405 | $9,796 |
Jul | $977 | $331 | $361 | $669 | $1,361 | $994 | $1,089 | $883 | $2,966 | $904 | $993 | $729 | $2,626 | $925 | $686 | $371 | $1,982 | $9,912 |
Aug | $1,526 | $947 | $261 | $278 | $1,486 | $478 | $808 | $798 | $2,084 | $564 | $169 | $189 | $922 | $320 | $222 | $896 | $1,438 | $7,456 |
Sep | $1,448 | $1,097 | $1,030 | $1,056 | $3,183 | $186 | $267 | $555 | $1,008 | $675 | $844 | $523 | $2,042 | $475 | $904 | $533 | $1,912 | $9,593 |
Oct | $2,058 | $823 | $720 | $521 | $2,064 | $270 | $214 | $329 | $813 | $575 | $569 | $765 | $1,909 | $245 | $765 | $149 | $1,159 | $8,003 |
Nov | $1,727 | $153 | $729 | $193 | $1,075 | $1,093 | $273 | $1,001 | $2,367 | $1,067 | $466 | $318 | $1,851 | $504 | $918 | $298 | $1,720 | $8,740 |
Grand Total | $18,345 | $6,253 | $6,020 | $6,188 | $18,461 | $6,770 | $7,397 | $6,568 | $20,735 | $8,132 | $7,745 | $7,080 | $22,957 | $4,350 | $6,816 | $5,368 | $16,534 | $97,032 |
In this sample, date filtering is performed externally by updating the Pivot Table’s data source based on a selected date range. Users can choose a Start Date and End Date using date pickers, and the table updates to show only the records that fall within that range. This external filtering method improves performance by avoiding in-component filtering. Instead, the data is pre-filtered at runtime using a custom applyDateFilter function, which compares the selected date range with each record’s date in the original dataset. This reduces the processing load on the Pivot Table and results in a more responsive user experience Note: Aggregation in the Pivot Table is performed only on the filtered data. Any records outside the selected date range are excluded from the summary calculations. More information on the Essential® JS2 Pivot Table can be found in this documentation section.