I think this explanation needs to be re-written for clarity. I think your example data set needs to be augmented with examples that meet the criteria you are discussing.
i need to remove these obs for each ItemID with bought_date that is after ItemSold date and keep only these with indicatorsold =1 or indicatorsold =0 and bought date before ItemSold date.
First, you don't have any examples in the data with bought_date that is after sold_date. Next, your instructions say what to do with bought_date after sold_date, and also what to do if bought_date is before sold_date, but your data has examples where bought_date is equal to sold_date (it's not after and it's not before) and so we don't know what should be done in that case.
I think this explanation needs to be re-written for clarity. I think your example data set needs to be augmented with examples that meet the criteria you are discussing.
i need to remove these obs for each ItemID with bought_date that is after ItemSold date and keep only these with indicatorsold =1 or indicatorsold =0 and bought date before ItemSold date.
First, you don't have any examples in the data with bought_date that is after sold_date. Next, your instructions say what to do with bought_date after sold_date, and also what to do if bought_date is before sold_date, but your data has examples where bought_date is equal to sold_date (it's not after and it's not before) and so we don't know what should be done in that case.
@sascode wrote:
I do understand data doesn't make sense with reality, however, I tried to ask for help based on provided variables and rows,
Thank you.
So does this mean you are not going to re-write the explanation to make it more clear what you want?
People here try to help you, but we assume you will also help us. If you have found another method, show us the solution so we can all benefit.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.