Newer Version Available
Group by a Custom Fiscal Year
Example
1q = load "opportunities";
2q = group q by 'CreatedDate_Year_Fiscal';
3q = foreach q generate
4 'CreatedDate_Year_Fiscal' as 'Fiscal Year',
5 count() as 'count';
6q = order q by 'CreatedDate_Year_Fiscal' asc;
7q = limit q 2000;The query returns:
| Fiscal Year | Count |
|---|---|
| 2017 | 2 |
| 2018 | 1 |
| 2019 | 1 |
| 2020 | 1 |
| 2021 | 1 |
| 2022 | 1 |