Dear All, I have the following data (two datasets): Company Date Company Date Value 1 199601 1 199606 10 1 199602 1 199706 11 1 199603 1 199806 12 1 199604 1 199605 1 199606 1 199607 1 199608 1 199609 1 199610 1 199611 1 199612 1 199701 1 199702 1 199703 1 199704 1 199705 1 199706 1 199707 1 199708 1 199709 1 199710 1 199711 1 199712 1 199801 1 199802 1 199803 1 199804 1 199805 1 199806 1 199807 1 199808 1 199809 1 199810 1 199811 1 199812 I need to obtain the following dataset: Company Date Value 1 199601 10 1 199602 10 1 199603 10 1 199604 10 1 199605 10 1 199606 11 1 199607 11 1 199608 11 1 199609 11 1 199610 11 1 199611 11 1 199612 11 1 199701 11 1 199702 11 1 199703 11 1 199704 11 1 199705 11 1 199706 12 1 199707 12 1 199708 12 1 199709 12 1 199710 12 1 199711 12 1 199712 12 1 199801 12 1 199802 12 1 199803 12 1 199804 12 1 199805 12 1 199806 . 1 199807 . 1 199808 . 1 199809 . 1 199810 . 1 199811 . 1 199812 . So, for each company I need to add "value" column from the second to the first dataset. The criteria how to add is the following. Add 10 if first date in the second dataset (199606) is greater (but not equal!!) than the dates in the first dataset. Then, add 11 if the second date in the second dataset (199706) is greater than the dates in the first dataset, but less or equal than 199606. Finally, add 12 if the third date in the second dataset (199806) is greater than the dates in the first dataset, but less or equal than 199706. Please note that I should have "value" column missing if date is greater or equal than 199806. I look forward to getting your reply. Kind regards, Ruslan
... View more