I have a table like this:
Id YearMonth Category Id1 1 201701 A1 A123 1 201702 A2 A456 1 201702 A3 A678 1 201702 A4 A456 1