Meliorainsights.com
  • Home
  • Tableau CRM
  • Field Notes
  • Non-Profits
  • Our Clients
  • About

Meliora Insights, LLC

​Data Cloud | CRM Analytics  (TCRM / Einstein Analytics) Consulting
​meliora - 'for the pursuit of the better'


A blog series distilling quantitative concepts /use-cases in CRM Analytics  (Einstein Analytics).

Picture

Compute relative vs. Compute expression. What is the difference?---- Dan Alindogan

1/31/2022

0 Comments

 
An interesting use-case came up with one of our supply chain clients. They needed to bin certain invoices into 1 of two categories--1) Full Service (any invoice that contains a 'Service Contract' line item OR 2) Retail (any invoice that does not have a service contract). This use-case utilizes 2 powerful TCRM nodes-- the compute relative and the compute expression.


At a high level, the compute relative enables a comparison up and down the table (ie rows) while the compute expression goes left > right ie columns. Down below I will show a step by step guide to how one would tackle this use case.


Step 1: Create a compute expression and label it as ‘Recasted Label’ (SAQL pseudocode follows)
Load ‘[Dataset]’


Case when ‘Description’’ == “Labor” then “AAA” else “[Description]”



Step 2: Use a Compute Relative Node to create a field called ‘Bin Type’ using the following settings in the Dialogue Box of that node
Group by InventorySort by ‘Recasted Label’ Asc
Create new field —> ‘Bin Type’
Aggregate f(x) = ‘first’



Step 3: Use a Compute Expression to create a new field “Class” using a CASE Statement.
 Case when ‘Bin Type’ != “AAA”    Then “Ship” else “Comprehensive”





Picture
Picture
0 Comments



Leave a Reply.

Site powered by Weebly. Managed by Hostwinds
  • Home
  • Tableau CRM
  • Field Notes
  • Non-Profits
  • Our Clients
  • About