02-07-2023 01:42 PM
Hi! I'm fairly new to DemandTool but I'm already a fan. I've been using the match functionality A LOT. Super happy that I don't have to play with excel sheets and lookups as much anymore..
I like being able to save my "scenarios" so I can just rerun them when needed. It took me a second to see that I could share those saved sceanrios between my different sandboxes and not have to recreate them in each of them...!
One question that I have (I don't know if it's possible), when we do a match is it possible to do a match on part of the field? let's say my match file has "04578" but I'm trying to match with a field that contains "XP-04578" I know I can add that in excel but would there be a way to just look at the last numbers ? There is comparison type for First X Letters. Is there a way of doing this for the Last X Letters maybe?
Solved! Go to Solution.
02-08-2023 08:26 AM - edited 02-08-2023 09:22 AM
Hi @CatherineL
To achieve this you can use Comparison Type "Regular Expression"
Regular Expression: Creates custom mapping types for any text field. Knowledge of regular expressions is required to use this mapping type. There are several free regex tutorial websites online that may want to reference to learn more.
Regular Expression mapping will use the first match located in the string:
Example:
Regular Expression: [0-9]+
Input data: 123 S Main St
Result: 123
Perhaps there is a fellow DemandTools Community member that is familiar with RegEx that could provide an expression that fits your use case.
Thank you for your post we really appreciate your engagement!
Dan
02-07-2023 10:19 PM
Hi Catherine,
Welcome to Validity Community . Great to know that you are enzoying your journey with DemandTools.I am from Validity Technical Support Team and happy to help you .
Yes it is possible to Match for the last letters by using Add Selection Condition and Add Condition option.
Step 1 (Add Selection Condition )
Step 2 (Add Condition)
I hope above information is helpful.
Regards,
Shubhra
09-25-2023 04:39 PM
Yes you are greaful
02-08-2023 08:26 AM - edited 02-08-2023 09:22 AM
Hi @CatherineL
To achieve this you can use Comparison Type "Regular Expression"
Regular Expression: Creates custom mapping types for any text field. Knowledge of regular expressions is required to use this mapping type. There are several free regex tutorial websites online that may want to reference to learn more.
Regular Expression mapping will use the first match located in the string:
Example:
Regular Expression: [0-9]+
Input data: 123 S Main St
Result: 123
Perhaps there is a fellow DemandTools Community member that is familiar with RegEx that could provide an expression that fits your use case.
Thank you for your post we really appreciate your engagement!
Dan
02-10-2023 05:24 AM
Hi yes, thanks for the hint I was able to do this regex 2 ways :
finding the last 5 characters of my string XP-04578 to match with the number I have :
(.{0,5})$
matching with eveything after "-" in my string XP-04578 to match with the number :
[^-]+$
thanks
02-13-2023 04:50 PM
Hi @CatherineL ,
I have to say I'm impressed with your RegEx skills! 😁
Do you have any RegEx resources that you think might help other customers? I use a few different sites to navigate RegEx myself. I like to test my expressions using regexr.com.
Thanks,
Anthony
Customer Success Manager
Get industry news, expert insights, strategies, and hot tips, served up fresh every week.
Visit the Validity blog