Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

How to get count after split activity for each subset

Avatar

Employee

Hi,

I have a query, and then a split activity to split based on the trigger segment locale. Now I need to count of records in each of these split subsets stored in a separate targetData variable. How can I achieve that?

Tried adding an enrichment activity in each of the split subsets to try and get the count of primary key (or countAll). But throws an error not a single-group group function.

Tried checking the "GroupBy" and also Group data by targeting dimension element in advanced properties. Then getting an error groupBy function is not allowed here.

Any help is highly appreciated.

Thanks,

Vignesh

1 Accepted Solution

Avatar

Correct answer by
Level 3

Yes, that should work. Name different JS variable against branch of the split.

vars.subset1 = vars.recCount

For the second split

vars.subset2 = vars.recCount

Then

vars.subset3 = vars.recCount

View solution in original post

3 Replies

Avatar

Level 3

Not sure if I understood your problem properly or not. But this is what I think can be done if I am understanding correctly

I will add a JS activity after the split or put some JS code in the advanced tab of the activity connecting each of the split. And in the JS I will create different variables like

vars.split1 = vars.recCount

For the second split

vars.split2 = vars.recCount

and so on.

If for some reason I have to do via WF, this might be needed

If you want to get a count you need to ensure that the PK is not added into the subset, otherwise it will give 1 against all the rows as "Grouping by targeting dimension" with group by PK.

I created a query activity and made the temp schema as starting point (output of split) and configured it as below. Note the "Disable automatic adding of the PK.." checkbox. After that I got the count and it doesn't have any targeting dimension as expected.

1764591_pastedImage_0.png

Avatar

Employee

Hi,

Thanks for your reply.

What I need is this: I have a split activity to split based on conditions into subset1, subset2, subset3. Now I need count of records in subset1, subset2 and subset3.

Should I add js script in each subset activity of the split?

Thanks,

Vignesh

Avatar

Correct answer by
Level 3

Yes, that should work. Name different JS variable against branch of the split.

vars.subset1 = vars.recCount

For the second split

vars.subset2 = vars.recCount

Then

vars.subset3 = vars.recCount