Would it be possible please to have a snapshot of your -Rule Engine- node (I guess is this node you are using) or at least copy and paste here the text of the rules you have written ?
May be there is a problem with the conditions you are using in your rules.
Hi @JaySmith123
Try to invert the order of your rules.
The first one needs to by applied to ‘Wise 2’, as the other one results ambiguous for both cases.
It seemed to work on a small dataset so thank you but I have 1000s and when I tried your same method it didnt work exactly as I would have liked. But thank you anyways for your help I’ll try to find some other way lol
Actually is there a way to extract the value from the string, append it to a new column and then simply do a sort of VLOOKUP to bring in the return value?
Something like this;
String - Search Term - Return Term
wwww.npc/abuja/wuse/property - abuja/wuse - Wuse
wwww.npc/abuja/wuse-2/property - abuja/wuse-2 - Wuse 2
@gonhaddock is right suggesting that the two conditions need to be inversed for the simple reason that if you have a $URL$ where the second condition is TRUE, the first will definitely be TRUE too but will never be checked.
The way the conditions works is a kind of if CONDITION1 then RESULT1 else if CONDITION2 then RESULT2 else … etc.
Just a comment about posting sentences with wild cards or other special characters that may be interpreted as web meta-characters. Here in your example they are not visible but they exist. It is preferable to insert code in posts with the option </> “Preformated Text” which preserves the content of the code inserted in the post. The right conditions should look then like this when they are posted:
$URL$ LIKE “*abuja/wuse-2*” => “Wuse 2”
$URL$ LIKE “*abuja/wuse*” => “Wuse”
with the wild cards “*” visible
Just a last comment, it is also always good to add an extra last condition which is executed if none of the previous were TRUE, for instance:
$URL$ LIKE “*abuja/wuse-2*” => “Wuse 2”
$URL$ LIKE “*abuja/wuse*” => “Wuse”
TRUE => "Nothing was changed or whatever you need as result here in this case"
This prevents to generate empty values as result if none of the previous condition was TRUE.