I have this dataset.
user Month item
A Jan X
A Jan Y
A Feb X
B Jan Z
B Feb X
A March Z
I require a result like the following:
user month Itemset CumItemset DistinctCount CumDistinctCount
A Jan X,Y X,Y 2 2
A Feb X X,Y 1 2
A March Z X,Y,Z 1 3
B Jan Z Z 1 1
B Feb X Z,X 1 2
I tried the code here but I want the cumulative count to restart with each new user.
Any ideas?