My client captures price in an s.eVar, and I am trying to figure out if there is a way to use the captured value in mathematical operations within Adobe Analytics. I can export the data and treat the text string as a number using Python or other programming approaches, but would like to be able to handle this within Adobe because I could include calculations in Workspace. Since numeric classifications have been removed, I'm not sure if what I want is even possible. Does anyone have a recommendation for this?
I can see how you could potentially do this using a combination of regex in the classification rule builder and a calculated metric. It's pushing the limits of what is achievable but it might just be do-able...
For the sake of explaining the concept let's simplify things by make the (false) assumption that your products range in value from $1 to $999 and are in whole numbers (you'll need to expand the concept to cover other values!).
First Stage: classifications
create 3 classifications, one for the units, one for the tens, and one for the hundreds.
Then use regex in the rule builder to dynamically split the value into the 3 classifications. Your regex is going to look something like this:
For the units (^\d*)(\d$) returning $2
For the tens (^\d*)(\d)(\d$) returning $2
For the hundreds (^\d*)(\d)(\d)(\d$) returning $2
For example if the value was 874 then:
"units" classification would be dynamically set to "4"
"tens" classification would be dynamically set to "7"
"hundreds" classification would be dynamically set to "8"
Second Stage: calculated metric
You've now got to build a calculated metrics along the lines of:
If "unit" equals "1" static number 1
If "unit" equals "2" then static number 2
If "unit" equals "3" then static number 3
Etc. (all the way to 9)
If "tens" equals "1" then static number 10
If "tens" equals "2" then static number 20
If "tens" equals "3" then static number 30
Etc. (all the way to 90)
If "hundreds" equals "1" then static number 100
If "hundreds" equals "2" then static number 200
If "hundreds" equals "3" then static number 300
Etc. (all the way to 900)
Obviously in the real world you'll need to expand the concept for more digits.
It's pretty crazy but I think it would work. Let me know if you try it!
You would not be able to run Mathematical operations at least within the UI for the sole reason that the evar values even if passed as numerical numbers would be passed as strings. I dont see any ways of this being achieved as per the current system configuration.