Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yipchunyu
Creator
Creator

Distribution Analysis with Class / Aggr Function

I would like to do a distribution analysis with below data.

Sale Record:

Name, Month, SaleAmt

sale A, 201501, 200

sale A, 201501, 100

sale A, 201502, 500

sale A, 201503, 400

sale B, 201502, 300

sale B, 201502, 50

sale B, 201503, 400

sale C, 201503, 300


Monthly Target (per person):

201501, 200

201502, 300

201503, 350


I would like to do a distribution analysis compare the total actual sales per person versus the monthly target (in terms of percentage).

With aggr function, I think I can build a virtual table like

Name, Month, SaleAmt

sale A, 201501, 300

sale A, 201502, 500

sale A, 201503, 400

sale B, 201502, 350

sale B, 201503, 400

sale C, 201503, 300


To further analysis, since the start month of these three sales are in different months, so the figures should be sth like:

For Sale A:

(300 + 500 + 400) / (200 + 300 + 350)

For Sale B:

(350+ 400) / (300 + 350)

For Sale C:

(300) / (350)


And based on these figures, I should then able to create a Grid chart to analysis the distribution (e.g. count of sale by variance in sale target).


However, I have no concrete ideas to do the aforesaid analysis except the function aggr / class should be used.  Any idea are welcomed.



0 Replies