i assume you are getting confused over the week 1 values. there are 2 entries for week 1, but only one of them is category 2, thats why i get 50% in that. in week 2 there are no new entries so the value remains 50%. In week 3 an entry is added in category 1, now the total no. of entries will be 3, and only one of them will be of category 2, hence 33.33% and so on.