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

Limit rows in each group using Split

Avatar

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
naveenj10058761
Level 3

30-08-2019

Hi,

I am trying to use split activity to limit each of the data group to 2 rows.

I am getting the following error

XTK-170036 Unable to parse expression ' AND [temp:extract-grp:@internalRank]<=2'.

XTK-170037 'AND' is a binary operator. At least one operand is missing.

Executing extraction 'Subset' (step 'Split')

I have three fields in my table - Delivery, URL, Counts

I would like to get the top 2 rows in the group of each Delivery, URL

For example:

Delivery     URL     count

D1          abc         5

D1          abc1       3

D1          ABC3     2

D2           pqr        7

D2          pqr1       6

D3          pqr2       5

Expected output:

Delivery     URL     count

D1               abc       5

D1               abc1     3

D2               pqr       7

D2               pqr1     6

I am using the following documentation to perform the limit.

https://docs.campaign.adobe.com/doc/AC/en/WKF_Targeting_activities_Split.html#Limiting_the_number_of...

Can you please suggest what could have caused this issue.

Thanks a lot

Naveen

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Anita_p
MVP

05-09-2019

Thanks Naveen for sharing it.

I have tried the same approach and it worked for me. The only difference is ,I have selected : limitations by group value (2) .

-Anita

Answers (8)

Answers (8)

Avatar

Avatar
Contributor
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

57 posts

Correct Reply

14 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
Level 3
saikatk2447661
Level 3

Likes

22 likes

Total Posts

57 posts

Correct Reply

14 solutions
Top badges earned
Contributor
Shape 1
Give Back 5
Give Back 3
Give Back
View profile
saikatk2447661
Level 3

04-09-2019

Hi Naveen,

You can do this in the first query block using window function.

You have to create an additional attribute as RowNum(PartitionBy(Delivery), OrderBy(Desc(count)))

Then you can create a filter in refine target as line Number <= 2

Thanks,

Saikat

Avatar

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Anita_p
MVP

03-09-2019

Hi Naveen,

Can you please help with the condition you have used in the split activity.

Meanwhile, you can try below approach :

Limit the selected records -> Keep only the first records -> Sort on the basis of "count" column from your table -> limit by grouping -> use the columns to group from your table -> limitations by grouping value (Enter 2)

Please ensure to add the additional columns in your initial query activity which you will be using in the split for sorting or grouping.

Let me know if this helps.

Thanks ,
Anita

Avatar

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
naveenj10058761
Level 3

05-09-2019

Hi Anita,

I am pasting the screenshots of split activity below.

1827748_pastedImage_1.png

Avatar

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Anita_p
MVP

04-09-2019

Hi Naveen,

Thanks for checking.

But it would be great if you can share the screenshot of split activity as just the error text is not really helping to understand the issue.

Also, if you want the top 2 records , I believe sorting on just the counts can help you get the required output.

Thanks,
Anita

Avatar

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Validate 1
MVP
Anita_p
MVP

Likes

117 likes

Total Posts

118 posts

Correct Reply

28 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Anita_p
MVP

10-09-2019

Hi Naveen,

Here you go:

Screen Shot 2019-09-11 at 9.19.37 am.png

Thanks,

Anita

Avatar

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
naveenj10058761
Level 3

05-09-2019

Hi Saikat,

Thanks for the suggestion. It worked for me.

However, I still would love to know how to do it using split activity.

Cheers...

Naveen

Avatar

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
naveenj10058761
Level 3

09-09-2019

Hi Anita,

Can you please share a screenshot of the 'limitations by group value (2)' screen.

Cheers...

Naveen

Avatar

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 3
naveenj10058761
Level 3

Likes

36 likes

Total Posts

38 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
naveenj10058761
Level 3

04-09-2019

Hi Anita,

Thanks for the response.

I have followed your notes and getting the same error.

XTK-170036 Unable to parse expression ' AND [temp:extract-grp:@internalRank]<=2'.
XTK-170037 'AND' is a binary operator. At least one operand is missing.
Executing extraction 'Subset' (step 'Split')

My method is given below which is giving me the same error.

Limit the selected records -> Keep only the first records -> Sort on the basis of All three columns (Delivery, URL, Counts) -> limit by grouping -> use the columns to group from your table (Delivery, URL) -> limitations by grouping value (Enter 2)

Thanks a lot

Naveen