cancel
Showing results for 
Search instead for 
Did you mean: 

Happy new DemandTool user - Can we find match on "last letters"?

CatherineL
Enthusiast

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? 

1 ACCEPTED SOLUTION

DanW_Validity
Validity Team Member
Validity Team Member

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

DanW_Validity_0-1675873368061.png

 

DanW_Validity_1-1675873395585.png

 

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

 

View solution in original post

5 REPLIES 5

ShubhC_Validity
Validity Team Member
Validity Team Member

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 )

ShubhC_Validity_1-1675836696307.png

Step 2 (Add Condition)

ShubhC_Validity_2-1675836825631.png

I hope above information is helpful.

Regards,

Shubhra

 

 

Yes you are greaful 

DanW_Validity
Validity Team Member
Validity Team Member

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

DanW_Validity_0-1675873368061.png

 

DanW_Validity_1-1675873395585.png

 

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

 

CatherineL
Enthusiast

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

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

Anthony Lardiere Jr
Senior Customer Success Manager