Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Get Different Email Domain Count in WorkFlow

Avatar

Avatar
Level 1
akshay2
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
akshay2
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
akshay2
Level 1

27-12-2019

I would like to query the Recipients table in Campaign and get an output with all the different email Domains ( of all recipients ) along with the count of these domains. 

My question is :

  1.  How can i achieve this in a Workflow 
  2.  How can i achieve this in the Javascript activity using sqlSelect / xtk:QueryDef operation 

Any help will be appreciated

 

thanks

a

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

969 likes

Total Posts

1,090 posts

Correct Reply

513 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

969 likes

Total Posts

1,090 posts

Correct Reply

513 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

30-12-2019

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:

  1. Add @domain, check the 'Group by' box next to it
  2. Add a col, type in count(@id)
  3. 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

Answers (0)