Allow more data manipulation in bionic rules

  • 2
  • Idea
  • Updated 3 months ago
I'd like to see the Rules Engine be able to have more flexibility when it comes to manipulating data rather than having to load data to another MDA object. 

Use case: 

A customer of mine is trying to assign a score based on certain information being present (or not present).
  1. They have six different features that they track among their customer base. This data is aggregated daily and shows up in terms of page views. 
  2. So if a customer has at least one page view for a feature, they should get a score of "1". If they don't have any page views for a feature, they should get a score of "0." An example data set might be 34 views for Feature A, 4 for Feature B, and 0 views for Features C through F. This customer would get a score of 2.
  3. What I want to be able to do is say for Feature, "34 views" now gives you a score of 1. "4 views" also gives you a score of 1. Zero views gets you zero. So then my final task would be a Transformation where I add up the scores for Features A through F.
  4.  Unfortunately, there's no easy way to do this that I can find out (I've asked around too), and I'd ideally like to avoid having to create a new MDA object.
If I'm missing something, I'd love to know. Otherwise, would love to see this considered as a feature request.
Photo of Spencer Engel

Spencer Engel, Employee

  • 5,054 Points 5k badge 2x thumb

Posted 3 months ago

  • 2
Photo of Joseph Siudzinski

Joseph Siudzinski, Employee

  • 4,944 Points 4k badge 2x thumb
For this, it would be nice to add in CASE statements and greater/less than compare statements in the bionic formula builder.
Photo of Jitin Mehndiratta

Jitin Mehndiratta, Product Manager

  • 3,026 Points 3k badge 2x thumb
Hi Joseph,

Case statement in Bionic Formula builder is definitely on our list. I will update more on the timelines as we make progress.
 
Thanks,
Jitin
Photo of Phil Hart

Phil Hart

  • 400 Points 250 badge 2x thumb
We do something similar to do a health score based on two "features":
Red = 0
Orange = 1
Green = 2

How about:
1. Dataset task to load customer list
2. Dataset task to load customer list where Feature A page views > 0; use a count distinct on a field that would be the same across all records so each customer has a value of 1 if present 
3. Merge on account ID keeping all results from Dataset in step 1 (full customer list)

(Repeat 2 & 3 as necessary for features B etc)

4. Final transformation with formula field adding the 1 field from features B, C etc to total

I think it's a crude use of the power of 1 field and, admittedly, it does involve a lot of steps.


That said, I still support this request as I've found myself creating a lot of MDA objects recently!
Photo of Spencer Engel

Spencer Engel, Employee

  • 5,054 Points 5k badge 2x thumb
Hey Phil, really appreciate the response. I thought of something similar, but unfortunately, for this specific case anyway, I kept running into the 15-task limit on bionic rules. Thanks again for the idea though!
Photo of Jitin Mehndiratta

Jitin Mehndiratta, Product Manager

  • 3,026 Points 3k badge 2x thumb
Hi Spencer, 

Can you provide some more details on the structure of the dataset you are using as source in Bionic Rules. The use case mentioned by you looks achievable with Filters like Page Views > 0 and using Count.
You can use numeric expression to calculate the score. In your case, the numeric expression can be something like the following:

Assume:
A = Feature A Page Views Count
B = Feature B Page Views Count
C = Feature C Page Views Count

Score = (A/A)+ (B/B)+ (C/C) where '/' = division

Let me know if that works

Regards,
Jitin