I have an index with below fields
SimID - Guid,
UserId - Guid,
WhenUserTrained - Datetime,
WhenUserClicked - Datetime.
Now I want to get the user count for given simulation who trained in past under any simulaton.
In sql I would write something like this
Select count(*) form Sim where SimId =='abc' and UserId in (select userid from sim where whenusertrained > today)