The values are storing in eVar, we have to group / buckets the values. I think the best way is to do classification rule builder
I would like to create buckets for the values like this:
0 – 3000
3001 -5000
5001 -10000
10001 – 30000
30001 – 50000
50001 – max
Can any one help me on this how to bucket / group the values in the regex or suggest me how to achieve above scenario.
Thanks all
Solved! Go to Solution.
Views
Replies
Total Likes
Regex for numbers is hard... since Regex is based on text values.. it doesn't recognize numerical values, it doesn't understand the concept of greater than / less than.. this means you will have to come up with complex regex rules that break the numbers down into expect values based on position and length.
Here is an article that explains how to create regex for numeric ranges:
https://www.regextutorial.org/regex-for-numbers-and-ranges.php
I also suggest you should use a tool like https://www.regextester.com/ to populate a bunch of values so that you can check that the rules you create match your expected output.
Good luck.
Views
Replies
Total Likes
Regex for numbers is hard... since Regex is based on text values.. it doesn't recognize numerical values, it doesn't understand the concept of greater than / less than.. this means you will have to come up with complex regex rules that break the numbers down into expect values based on position and length.
Here is an article that explains how to create regex for numeric ranges:
https://www.regextutorial.org/regex-for-numbers-and-ranges.php
I also suggest you should use a tool like https://www.regextester.com/ to populate a bunch of values so that you can check that the rules you create match your expected output.
Good luck.
Views
Replies
Total Likes
Here's something that's not immediately obvious about Classification Rule Builder: you can have more than one rule that classify a single eVar. AA will process the rules from #1 to #last.
So you could do the following:
Rule Number Regex Classified Value
1 * Max
2 ^(3000[1-9]|3[1-9][0-9]{3}|4[0-9]{4}|50000)$ 30001 - 50000
3 ^(1000[1-9]|1[1-9][0-9]{3}|2[0-9]{4}|30000)$ 10001 - 30000
etc
Note: I have not tested any of the above regexes!
When you've set it up correctly, then when you test this rule set, you should (hopefully) get back your expected buckets.
Views
Replies
Total Likes
Thanks all for the reply.
I have found Regex Numeric Range Generator URL https://3widgets.com/ . I think it will be helpful for all us.
Views
Likes
Replies
Views
Likes
Replies