Is it possible to extract the two right characters of an Element's name? Similar to the =right() formula in Excel?
There isn't a function exactly like the =right() function in Excel, but it's definitely possible to extract parts of a string in Analysis using the Mid function.
In this example, I used the word "String" as my source, and the Mid function returns all the characters to the right of (and including) the position specified in the second parameter:
If your source strings don't all have the same number of characters, you can use the Len function in conjunction with Mid to set the starting position as the second to last character to get the right two characters like so:
You can also pass attribute values to these functions. In this example I have defined a string attribute 'Example' that has value of "String" and used the same functions pointing to the Attribute instead:
Finally, to get the Element name as a string, String Builder supports Substitution parameters, so you can create a String Builder Attribute that gets the name of the element with %element% and use this attribute in the Analysis:
I hope this helps!
Yes it's possible, and you can do it easily enough using just the StringBuilder data reference. There are both Left() and Right() functions available. For example, the following StringBuilder config will return the right 2 characters of the owning Element's name:
You could use the analytics alternative mentioned above by David, and whichever method you choose will depend on how you intend to consume this substring information.
Retrieving data ...