Home > database >  [for] about sas under the same variable sum calculation problem
[for] about sas under the same variable sum calculation problem

Time:11-04

To ask everybody the teacher, now I have two columns of data, data format is as follows:
Id price multiplier tag
A 100 0.1 1
Ac 101 0.2 1
Ab 102 0.5 1
Ba 80 0.6 2
BC 100 0.43 2
Bd 103 0 1
Af 50 2, 3,
Ca 150 0.33 3
CD 60 0.7 2

I want to help, I would like to calculate under the same label type, each id (price * multiplier)/sum (price)
=1, such as the label is (101 * 100 * 0.1 + 0.2 + + 103 * 102 * 0.5 0)/(100 + 101 + 102 + 103);
I want to ask about using sas expression should be how to write?
  • Related