Hi , below is the sample dataset.
| date | bucket | bal |
| 30-Sep-18 | 0 | 10 |
| 30-Sep-18 | 1 | 20 |
| 30-Sep-18 | 2 | 30 |
| 30-Sep-18 | 3 | 40 |
| 30-Sep-18 | 4 | 50 |
| 30-Sep-18 | 5 | 60 |
| 30-Sep-18 | 6 | 70 |
| 30-Sep-18 | 7 | 80 |
| 30-Sep-18 | 9 | 90 |
I wanted to sum the values using SUM function..
if bucket in '(1,9) then balance else display the balance. like below
below table
| 30-Sep-18 | 0 | 10 | ||
| 30-Sep-18 | 1 | 110 | 20+90 | bucket 1& 9) |
| 30-Sep-18 | 2 | 30 | ||
| 30-Sep-18 | 3 | 40 | ||
| 30-Sep-18 | 4 | 50 | ||
| 30-Sep-18 | 5 | 60 | ||
| 30-Sep-18 | 6 | 70 | ||
| 30-Sep-18 | 7 | 80 | ||
| 30+ | sum(of bucket >2) | |||
| 90+ | sum(of bucket >4) |
appreciate your help.thanks RS
Assuming your data contains more than one day dates - should summary be per day ?
What kind of output you want - data-set or listing ?
Please post how should final output look like.
What code did you try ?
Please ignore the query.I have figure out the solution in proc sql .thanks
appreciate everyone for quick replies.thank you
cheers!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.