Quantcast
Viewing all articles
Browse latest Browse all 217217

cumulative count of grouped percentages without being filtered

Hi experts,

 

My data is as follow:

Each ID is an unique product.

Products was sent and its sending time is in column "Sending week", its receiving time is in column "Receiving week". Time is count by week number in a year. 

if column "Receiving week" is blank, it means " haven't received yet".

 

IDSending weekReceiving week
100week 1 
182week 1week 47
183week 1week 47
199week 1 
200week 1 
184week 1week 45
185week 2week 46
186week 2week 45
187week 3week 47
188week 3week 45
189week 3week 45
190week 3week 46
191week 3week 46
192week 3week 47

 

I want to create a column/measure in order to calculate grouped percentages of received products compared with the total number sent products. For example:

- total send of week 1 = count of all week 1 in column A = counta(week 1) = 5

 

- % receive up to week number 45 of send in week number 1 = count of column D (week 45)/count of column A(week1) = 1/5 = 20%

 

- % receive up to week number 47 of send in week number 1 = count of column D (week 47) + (week 45)/count of column A(week1) = (2 + 1)/5 = 60%

 

Desired output:

 

         Explanation 
sending week receiving week count of receiving week Percentage  count of receiving week (per sending week)receiving percentage
week 1 week 45 1 20%  1(= week 45 appears once from "sending week" week 1)20% because = count of "week 45"/count of sending week " week 1"= 1/5
week 1 week 47 2 60%  2 (=week 47 appears 2 times from "sending week" week 1)60% because = count of "week 45" + count of "week 46" + count of "week 47" =  (1+0 +2)/5
week 2 week 45 1 50%  150% because =count of "week 45"/count of sending week"week 2"= 1/2
week 2 week 46 1 100%  1100% because =count of "week 45" + count of "week 46"/count of sending week"week 2"= (1+ 1)/2
week 3 week 45 2 33%  2 33%  because =1/3
week 3 week 46 2 66%  266% because = (1+1)/3
week 3 week 47 2 100%  2100% because = (1+1+1)/3

 

The problem is that once I filter a "receiving week", column "sending week" accordingly is filtered, which lead to the percentage of receiving week/sending week is always 100%- incorrect.

 

I would like to consult you and hopefully this issue can be solved.

 

Many thanks and regards,

Cindy


Viewing all articles
Browse latest Browse all 217217

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>