Groupby on multiple fields using DQL

Thanks for the quick response.

So, multiple predicates does work as follow.

query queryUserStatusAggregation($eventFilter: string, $startTime: string, $endTime: string) {	
            filteredStatuses as var(func: type(UserStatus))
                @cascade(UserStatus.event)
                @filter(between(UserStatus.time, $startTime, $endTime))
            {
                UserStatus.event @filter(uid($eventFilter)) {
                    uid
                }
            }

            queryUserStatusAggregation(func: uid(filteredStatuses))
                @groupby(UserStatus.type,UserStatus.time, UserStatus.user)
            {
                count(uid)
            }
        }

Response

{
  "data": {
    "queryUserStatusAggregation": [
      {
        "@groupby": [
          {
            "UserStatus.type": "UNREGISTERED",
            "UserStatus.time": "2021-05-30T11:02:05Z",
            "UserStatus.user": "0x684ac",
            "count": 1
          },
          {
            "UserStatus.type": "UNREGISTERED",
            "UserStatus.time": "2022-09-11T13:50:00Z",
            "UserStatus.user": "0x684a8",
            "count": 1
          },
          {
            "UserStatus.type": "REGISTERED",
            "UserStatus.time": "2022-09-11T13:50:58Z",
            "UserStatus.user": "0x684b6",
            "count": 1
          }
       ]
    }
}

But it doesn’t address the final results that I want which requires the conversion of timezone at runtime.

I assume the only option for now would be to pre-calculate the groupby key during mutation.

In the above scenario it would be to add an extra date field which is timezone aware and gets populated during the mutation. I’m not sure if that would be scalable enough as this approach will require a new predicate per timezone we support in our application and a data migration whenever we add a new timezone support.

Do you think it’s feasible approach or we can have a better approach to solve this problem i.e groupby using timezone aware date?

Thanks!