I have an application that load only Codes having a flag called Policy = 'Y'.
The problem is: along the time, these Codes enter and leaves the Policy, so if they leave ( Policy = 'N'), they are not being loaded in that month (my date time is Month and Year).
I want to know the Quantity of Codes that left the Policy (eg: they were loaded in 08-2018 but not in 09-2018) and also the Codes that entered in Policy (eg: they weren't loaded in 08-2018 but so in 09-2018).
Displaying in a bar chart as below:
The logic would be more or less like this:
Count ( Containing Previous [Date] Codes)
Count ( Not Containing Previous [Date] Codes)
But I have no idea how to count them, any suggestions?