You need to work similar like How to write the following N1ql Query - #2 by vsr1
similar id aggregate all products and enc, status and use case.
You need to work similar like How to write the following N1ql Query - #2 by vsr1
similar id aggregate all products and enc, status and use case.