Compare data from different datasets:
Dataset 1 contains history of customer records – (Number of kids(kid_count) who ever in care of the customer and the date(FCH_date) they came into care.)
ID
FCH_Date
KID_COUNT
945666
20060517
1
945666
20060614
1
945666
20071005
1
945666
20080701
1
945666
20080726
2
945666
20081025
2
945666
20081209
2
945666
20090205
2
945666
20090313
2
945666
20100719
3
945666
20110517
3
945666
20110619
4
945666
20110918
4
945666
20120101
4
945666
20120223
4
945666
20120405
4
945666
20120713
2
945666
20120715
1
945666
20120810
3
945666
20120820
4
945666
20121120
3
945666
20140901
3
945666
20141201
2
945666
20150223
1
945666
20150701
2
945666
20160619
3
Dataset 2 contains 1 record before and one after the activation date(PDNS_DOE) transactions of customers
ID
PDNS_DOE
kid_count_after
FCH_Date_after
KID_Count_before
FCH_Date_before
945666
20141130
3
20141201
3
20140901
945666
20071019
2
20081025
1
20071005
Need to select customers where the kid count has increased since the FCH_Date_after, the tricky bit is “since FCH_Date_before need to check for increase in count, and this could be as demonstrated in the dataset1. If there is an increase then output ID and PDNS_DOE.
Help !!!!!!!!
... View more