BookmarkSubscribeRSS Feed
kyath_sas
Calcite | Level 5
Hi could any one help on below
Input dataset :
Keyid Coupon Month Price
1 12b 201701 100
1 12c 201702 0
1 12b 201703 -100
2 14c 201702 0
2 14b 201703 200
3 15b 201705 100
3 15c 201706 0
3 15b 201707 -100
3 15b 201708 200
4 16b 201705 250
4 16c 201706 0



Output below like this

1 12b 201701 100
1 12c 201702 0
1 12b 201703 -100
3 15b 201705 100
3 15c 201706 0
3 15b 201707 -100
4 16b 201705 250
4 16c 201706 0
Which are the keyid have coupon ends with’c’ then paid amount will be refund
2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Can you be a little more specific in your requirements?

 

For example, why is Keyid=2 left out of the output data but Keyid=4 is in there?

kyath_sas
Calcite | Level 5
Keyid 2 coupon came 201702 actual paid month 201703 we dont need this keyid because refund is not possible in this situation . Select keyid paid month prior than coupon month

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 748 views
  • 0 likes
  • 2 in conversation