Hi,
I have a scenario below
ID | Type | Country | Date |
---|---|---|---|
123AP1 | P | US | 1/1/2009 |
123A1 | A | WO | 4/4/2010 |
123A2 | A | US | 6/6/2011 |
123A3 | A | US | 8/8/2011 |
So, the logic I need to display is -
If, Type = P AND Country=US then count 1 where ID has 123AP1
else If Type = A AND Country=US then count 1 more where ID has 123AP1 on date 1/1/2009 (i.e. on Type P date)
So, result should show
ID | Type | Country | Date | Count |
---|---|---|---|---|
123AP1 | P | US | 1/1/2009 | 3 |
123A1 | A | WO | 4/4/2010 | 0 |
123A2 | A | US | 6/6/2011 | |
123A3 | A | US | 8/8/2011 |