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.
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.