In the below given table, I wanna compare two records eg. Record 190 and 191 so for each pair I have two historical status in last column, I wanna compare those pairs and then i wanna check that the NO status record's data should be recent than the YES status pack.
I have sorted the data that in Descending order to get YES record first and then the NO record next to it.
RecordID | Pack Id | Pack Indication Id | Regulatory Indication Id | Assessment Publication Date | Is Historical |
190 | 451674 | 711780 | 736715 | 23-10-2019 | YES |
191 | 451674 | 711780 | 736715 | 09-09-2020 | NO |
192 | 451675 | 711782 | 736717 | 23-10-2019 | YES |
193 | 451675 | 711782 | 736717 | 09-09-2020 | NO |
194 | 451676 | 711784 | 736719 | 23-10-2019 | YES |
195 | 451676 | 711784 | 736719 | 09-09-2020 | NO |
A quick response would be appreciated
Hey @Pankaj_G,
When you say you want to compare them, what kind of output are you looking for? Do you need a column to say which columns are different between 191 and 190? Could you show your expected result?
Thanks,
Ira
@Pankaj_G Another way of doing this is like this:
First, I grouped by the pack ID's as they seen to distinguish each pair of records we want to compare. Then using datetime parse function so I can compare the dates as a date datatype I check if the row below the historical row if its date is less. If yes I identify it with "Bad" else just use the row above.
Any questions or issues please ask :)
HTH!
Ira