Classification Builder

Avatar

Avatar
Ignite 1
Level 3
1982luca
Level 3

Likes

7 likes

Total Posts

324 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Ignite 1
Level 3
1982luca
Level 3

Likes

7 likes

Total Posts

324 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Boost 3
Boost 1
Applaud 5
View profile
1982luca
Level 3

07-01-2021

Hello everyone,

 

I have a question on Classification Builder. I want to map(filter) all empty value like " " with N/A and map NOT empty value with its value

How can I build the regex?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

200 likes

Total Posts

606 posts

Correct reply

121 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

200 likes

Total Posts

606 posts

Correct reply

121 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

07-01-2021

You could use this RegEx pattern to match an empty string.

^$

^ means match from the start of the string.

$ means match up to the end of the string.

Or you can use the RegEx pattern 

^(?![\s\S])

Reference: https://stackoverflow.com/a/28652413 

Avatar

Avatar
Affirm 50
MVP
evolytics_brian
MVP

Likes

80 likes

Total Posts

170 posts

Correct reply

54 solutions
Top badges earned
Affirm 50
Applaud 25
Establish
Seeker
Give Back
View profile

Avatar
Affirm 50
MVP
evolytics_brian
MVP

Likes

80 likes

Total Posts

170 posts

Correct reply

54 solutions
Top badges earned
Affirm 50
Applaud 25
Establish
Seeker
Give Back
View profile
evolytics_brian
MVP

07-01-2021

@1982luca - Classification rules execute in a top-down sequence, with the last rule matched setting the value you see in reports. For example, if a value matches three separate rules, the value set in the third rule is what appears in reports. Based on this, I've had success setting a catch-all rule as the first rule in the list. In your case, it would look something like this:

  • Rule Type: RegEx
  • Match Criteria: .*
  • Set Value To: N/A

This ensures that all values (including empty strings/spaces) are first set to "N/A". If a value matches a subsequent rule, your report will display the value assigned in that subsequent rule. If not other rules are matched, you'll see "N/A" in your reports. Any hits where no value is passed into the prop/eVar will not be assigned classified value.