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

How to set dynamic values in Classification

Avatar

Avatar
Validate 1
Level 1
prahme
Level 1

Likes

0 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
prahme
Level 1

Likes

0 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Applaud 5
View profile
prahme
Level 1

26-10-2020

Hello,

 

I have a variable I want to apply Classification to.

 

The format will be something like : %CountryCode%-Homepage-%LanguageCode% (just an example)

 

Where %CountryCode% and %LanguageCode% are dynamically sent by the developers. (ex : FR-Homepage-FR)

 

I want to use the classification to KEEP the dynamic values and change the value in the middle only - to have something like this : 

 

%CountryCode%-HP-%LanguageCode%

 

Is this possible in Classification Rule Builder ? 

I want it to be a classification because I want it to be retroactive to old values.

 

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
evolytics_brian
MVP

Likes

70 likes

Total Posts

145 posts

Correct Reply

44 solutions
Top badges earned
Establish
Seeker
Give Back
Engage 1
Boost 50
View profile

Avatar
Establish
MVP
evolytics_brian
MVP

Likes

70 likes

Total Posts

145 posts

Correct Reply

44 solutions
Top badges earned
Establish
Seeker
Give Back
Engage 1
Boost 50
View profile
evolytics_brian
MVP

26-10-2020

@prahme  -

It certainly is possible. You'll just have to use a regex match in the rule, then reassemble the parts to build the string you want to see in reports. Your regex may vary, but the simplest approach would be something like the following:

evolytics_brian_2-1603721790073.png

 

This assumes we're looking for the "Homepage" value, you always have three (3) parts to the value coming in, and there are only two (2) dashes/hyphens in the string. The leading "(?i)" ensures this is a case-insensitive search (so both "Homepage" and "homepage" would match). The result should be four (4) total match groups, with $0 always representing the original value as shown in the sample image above. 

To stitch it back together, you can reference the match groups to keep the dynamic values. In the example, this would be $1 for the leading "FR" and $3 for the trailing "FR". In the middle, you can use a literal string, such as "HP" to complete the updated/classification value:

evolytics_brian_3-1603721948686.png

With this approach, you'll have to build a rule for every variation you expect to find in the middle ($2) position of the original string. However, the leading (CountryCode) and trailing (LanguageCode) values do not have to be anticipated because we're using a wildcard to match the strings.

 

Answers (0)