Hi,
1: Use a query activity, with nms:recipient as targeting/filtering dimensions, @ID>0 as where clause and select clause defined by Edit additional data:
- Add @domain, check the 'Group by' box next to it
- Add a col, type in count(@id)
- Click 'Advanced parameters...' link, Check Disable automatic adding of primary key
2: Don't use sqlSelect unless there is a clear reason, e.g. complex queries that have perf requirements. In querydef:
var recipients = xtk.queryDef.create(
<queryDef schema="nms:recipient" operation="select" distinct="true">
<select>
<node expr="@domain" groupBy="1"/>
<node expr="count(@id)" alias="@count"/>
</select>
</queryDef>).ExecuteQuery();
for each (var recipient in recipients.recipient) {
logInfo(recipient.@domain, recipient.@count);
}
Thanks,
-Jon