Question Re: Calculations with numbers stored as text in s.eVar in Adobe Analytics Questions
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/395937/comment-id/21501#M21501
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?Wed, 03 Feb 2021 21:36:23 GMTjantzen_belliston-Adobe2021-02-03T21:36:23ZCalculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364592
<P>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?</P>Sun, 31 May 2020 19:34:21 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364592brentrad2020-05-31T19:34:21ZRe: Calculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364690/comment-id/18664#M18664
<P>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.</P>Mon, 01 Jun 2020 17:48:53 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364690/comment-id/18664#M18664srola2020-06-01T17:48:53ZRe: Calculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364914/comment-id/18679#M18679
<P>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...</P><P> </P><P>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!).</P><P><STRONG> </STRONG></P><P><STRONG>First Stage: classifications</STRONG></P><P>create 3 classifications, one for the units, one for the tens, and one for the hundreds.</P><P>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:</P><P>For the units (^\d*)(\d$) returning $2</P><P>For the tens (^\d*)(\d)(\d$) returning $2</P><P>For the hundreds (^\d*)(\d)(\d)(\d$) returning $2</P><P> </P><P>For example if the value was 874 then:</P><P>"units" classification would be dynamically set to "4"</P><P>"tens" classification would be dynamically set to "7"</P><P>"hundreds" classification would be dynamically set to "8"</P><P> </P><P><STRONG>Second Stage: calculated metric</STRONG></P><P>You've now got to build a calculated metrics along the lines of:</P><P> </P><P>If "unit" equals "1" static number 1</P><P>Plus</P><P>If "unit" equals "2" then static number 2</P><P>Plus</P><P>If "unit" equals "3" then static number 3</P><P>.</P><P>.</P><P>.</P><P>Etc. (all the way to 9)</P><P>Plus</P><P>If "tens" equals "1" then static number 10</P><P>Plus</P><P>If "tens" equals "2" then static number 20</P><P>Plus</P><P>If "tens" equals "3" then static number 30</P><P>.</P><P>.</P><P>.</P><P>Etc. (all the way to 90)</P><P>Plus</P><P>If "hundreds" equals "1" then static number 100</P><P>Plus</P><P>If "hundreds" equals "2" then static number 200</P><P>Plus</P><P>If "hundreds" equals "3" then static number 300</P><P>.</P><P>.</P><P>.</P><P>Etc. (all the way to 900)</P><P> </P><P>Obviously in the real world you'll need to expand the concept for more digits.</P><P> </P><P>It's pretty crazy but I think it would work. Let me know if you try it!</P>Tue, 02 Jun 2020 18:23:46 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364914/comment-id/18679#M18679A_Wathen2020-06-02T18:23:46ZRe: Calculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364916/comment-id/18680#M18680
That's an interesting approach. I had already created classifications for price groupings (e.g. $250, $500, etc. increments), and with prices up to $100,000 I may increased create these calculated metrics by group. Not quite the ideal, but it's worth experimenting with. Hopefully Adobe figures out a replacement for numeric classifications.Tue, 02 Jun 2020 19:23:40 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/364916/comment-id/18680#M18680brentrad2020-06-02T19:23:40ZRe: Calculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/366238/comment-id/18742#M18742
I've used a very similar approach to make Calculated Metrics based on Survey scores that have a possible range of 0 to 100; have to admit that I didn't come up with the additional step of converting into Units / Tens / Hundreds, which will save me some tedium next time!Thu, 11 Jun 2020 10:10:41 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/366238/comment-id/18742#M18742BarryLennon2020-06-11T10:10:41ZRe: Calculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/366240/comment-id/18743#M18743
One additional point: it may be worth "seeding" the values using Classification Importer (e.g., make a sheet with all of the values from $1 to $100000 and upload it) rather than the Classification Rule Builder approach. If you have decimals and are willing to forego that level of precision, use Classification Rule Builder to discard the decimal then "sub-classify" using Classification Importer as laid out here.Thu, 11 Jun 2020 10:13:45 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/366240/comment-id/18743#M18743BarryLennon2020-06-11T10:13:45ZRe: Calculations with numbers stored as text in s.eVar
https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/395937/comment-id/21501#M21501
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?Wed, 03 Feb 2021 21:36:23 GMThttps://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/re-calculations-with-numbers-stored-as-text-in-s-evar/qaq-p/395937/comment-id/21501#M21501jantzen_belliston-Adobe2021-02-03T21:36:23Z