DATA Step, Macro, Functions and more

Percentage calculation

Reply
Occasional Contributor
Posts: 7

Percentage calculation

Finyear        Value1        value2             Percentage

20142015     26469        421596             6%

20142015     370644      14582164         2%

20152016    108747        643178             16%

20152016     1259525     17519233          7%

 

My Query is: I am getting percentage row level wise but when i am trying to sum up finyear wise i.e. vertically

the value is changing , means i am not getting result after aggregation.

Kindly provide me solution regarding this.

 

Regards,

Harsh Patel

Valued Guide
Posts: 516

Re: Percentage calculation

Please post the desired output and code used to calculated the percentages.

Occasional Contributor
Posts: 7

Re: Percentage calculation

[ Edited ]
Posted in reply to andreas_lds

Row level division calculation is possible in EG but we want to show output in SAS VA which should be aggregated but  right now it shows the summation of the row level in EG.

Kindly suggest some solution.

Finyear                         State                           City                       income               expense         expratio

20142015                     Guj                              Ahmd                    100                      80                 0.8

20142015                     Guj                              Vadodara               200                     150               0.75

20142015                     Maharashtra               Mumbai                  250                     200               0.8

20142015                     Maharashtra               Pune                      200                      100               0.5

20152016                     Guj                              Ahmd                    150                       100              0.66

20152016                     Guj                              Vadodara              120                      100               0.83

 

We want to show this data in SAS va.  If the user  does not select any filters the column should show overall expratio, if he selects particular state it should show expratio of that particular state.If they select state and city it should show accordingly.

 

Thanks,

Harsh Patel

Ask a Question
Discussion stats
  • 2 replies
  • 100 views
  • 0 likes
  • 2 in conversation