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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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