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!
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.