Compute Expression in Einstein Analytics

Admin Configuration, Salesforce

Compute expression is the most powerful tool which allows you to add additional fields, additional derived fields into the dataset without changing/altering the source data.

In this blog, we are going to sort the stages based on our business need instead of using the standard sort order which does follow the alphabet order.

Below is the image before sorting the stage values

We wanted to sort the Stages like below

To Achieve this, we are going to use compute expression while preparing the dataset inside the Dataflow

We are using Case statement here to check the stage name values and then assigning the new value for the sage. Below is the formula

case
when 'Opp.StageName' == "Id. Decision Makers" then "[1] Id. Decision Makers"
when 'Opp.StageName' == "Value Proposition" then "[2] Value Proposition"
when 'Opp.StageName' == "Prospecting" then "[3] Prospecting"
when 'Opp.StageName' == "Qualification" then "[4] Qualification"
when 'Opp.StageName' == "Needs Analysis" then "[5] Needs Analysis"
when 'Opp.StageName' == "Negotiation/Review" then "[6] Negotiation/Review"
when 'Opp.StageName' == "Perception Analysis" then "[7] Perception Analysis"
when 'Opp.StageName' == "Proposal/Price Quote" then "[8] Proposal/Price Quote"
when 'Opp.StageName' == "Closed Won" then "[9] Closed Won"
else "[9] Closed Lost"
end

Note: – We have used # because # will give us the stages in the orders.

Follow this link to lear more about Compute Expression

Check out the below link for more scenarios where you can use Compute Expression.

Keep Learning & Keep Sharing

#SharingIsCaring #AskPanther

Resources