So I have table containing a list of products per customer and a status
What I want to is count by status and customer by wanted a rolling total.
Example Raw Table
AccountKey | Cumulative | InstallDate | Number | Category | CategoryFull | CategoryPEO |
96609|PANTHER | 1 | 10/27/2013 | 4397205 | FULL | 4397205 | |
96609|PANTHER | 2 | 1/26/2014 | 4397593 | FULL | 4397593 | |
96609|PANTHER | 3 | 4/27/2014 | 4577138 | FULL | 4577138 | |
96609|PANTHER | 4 | 6/28/2015 | 5117108 | PEO | | 5117108 |
131542|PANTHER | 1 | 11/22/2015 | 5160542 | FULL | 5160542 | |
131542|PANTHER | 2 | 10/23/2016 | 9294480 | PEO | | 9294480 |
Required result
AccountKey | Cumulative | InstallDate | Number | Category | CategoryFull | CategoryPEO | FullCount | PeoCount |
96609|PANTHER | 1 | 10/27/2013 | 4397205 | FULL | 4397205 | | 1 | 0 |
96609|PANTHER | 2 | 1/26/2014 | 4397593 | FULL | 4397593 | | 2 | 0 |
96609|PANTHER | 3 | 4/27/2014 | 4577138 | FULL | 4577138 | | 3 | 0 |
96609|PANTHER | 4 | 6/28/2015 | 5117108 | PEO | | 5117108 | 3 | 1 |
131542|PANTHER | 1 | 11/22/2015 | 5160542 | FULL | 5160542 | | 1 | 0 |
131542|PANTHER | 2 | 10/23/2016 | 9294480 | PEO | | 9294480 | 1 | 1 |
I've been trying to use AutoNumbers but I couldn't get it do work
autonumber(alt(Number,'NA'),AccountKey)-1 as Serial
,autonumber(alt(CategoryFull,'NA'),AccountKey)-1 as SerialCategoryFull
,autonumber(alt(CategoryPEO,'NA'),AccountKey)-1 as SerialCategoryPEO
example
AccountKey | Cumulative | InstallDate | Number | Category | CategoryFull | CategoryPEO | SerialCategoryFull | SerialCategoryPEO |
96609|PANTHER | 1 | 10/27/2013 | 4397205 | FULL | 4397205 | | 1 | 0 |
96609|PANTHER | 2 | 1/26/2014 | 4397593 | FULL | 4397593 | | 2 | 0 |
96609|PANTHER | 3 | 4/27/2014 | 4577138 | FULL | 4577138 | | 3 | 0 |
96609|PANTHER | 4 | 6/28/2015 | 5117108 | PEO | | 5117108 | 0 | 4 |
131542|PANTHER | 1 | 11/22/2015 | 5160542 | FULL | 5160542 | | 1 | 0 |
131542|PANTHER | 2 | 10/23/2016 | 9294480 | PEO | | 9294480 | 0 | 2 |