Using webi 4.2:
Each record contains

I've created a variable, Category, using if conditions, but it only evaluates the record once. For example, ID 24 is identified as only New when it should be identified as both New and Termed.
=If [EffDate] >='1/1/2022' And [EffDate]<='12/31/2022' Then "New" ElseIf [ExpDte] >='1/1/2022' And [ExpDte]<='12/31/2022' Then "Termed" Else "NA"
I need to identify each ID as to whether the state was newly added during 2022 and also whether the state was termed in 2022 (Category). The resulting table would look like:

Then for each state, I need to count the number of categories and format as follows:

Any help in figuring this out would be appreciated.