[ad_1]
Final Up to date on September 14, 2022 by Rakesh Gupta
Massive Thought or Enduring Query:
- Learn how to work with the mixture capabilities in Salesforce Stream?
Targets:
After studying this weblog, you’ll be capable to:
- Discover out the NUMBER (Rely) of rows for question standards.
- Discover out the MAXIMUM worth of a discipline for question standards.
- Discover out the MINIMUM worth of a discipline for question standards.
- Discover out the AVERAGE worth of a numeric discipline for question standards.
- Discover out the SUM of a numeric discipline for question standards.
- And far more
What are Aggregate Capabilities?
A SOQL mixture operate calculates the values of a number of rows grouped as enter on particular standards to type a single worth. Numerous Combination Capabilities are:
- COUNT – Returns the variety of rows matching the question standards.
- MAX – Returns the utmost worth of a discipline.
- MIN – Returns the minimal worth of a discipline.
- AVG – Returns the common worth of a numeric discipline.
- SUM – Returns the full sum of a numeric discipline.
As of the Winter’23 launch, Salesforce Stream doesn’t help mixture capabilities like SOQL. On the similar time, there are many conditions the place you simply wish to calculate the depend of rows within the File Assortment Variable or discover out the common quantity of alternatives for an account – such eventualities may be fulfilled with out utilizing mixture capabilities.
Enterprise Use case I (MAX Operate)
Jason Herr is a Resolution Architect at Gurukul on Cloud (GoC). He needs to grasp the best way to discover the chance with the utmost quantity for a given account.
Automation Champion Method (I-do):
We are going to use a Get Information factor to resolve the above enterprise requirement. It doesn’t matter what sort of movement you’re engaged on, however the logic is identical.
Step 1: Outline Stream Properties
- Click on Setup.
- Within the Fast Discover field, sort Flows.
- Choose Flows, then click on on the New Stream.
- Choose the File-Triggered Stream possibility, click on on Create and configure the movement as follows:
- Object: Account
- Set off the Stream When: A document is created or up to date
- Set Entry Standards
- Situation Necessities: None
- Optimize the Stream For Quick Discipline Updates
- Click on Performed.
Step 2: Including a Get File Component to Discover the Most Alternative Quantity
The subsequent step is to make use of the Get Information factor to search out the utmost alternative quantity on a given account.
- On Stream Designer, click on on the +icon and choose the Get Information factor.
- Enter a reputation within the Label discipline; the API Identify will auto-populate.
- Choose the Alternative object from the dropdown listing.
- Choose All Situations Are Met (AND).
- Set Filter Situations
- Row 1:
- Discipline: AccountId
- Operator: Equals
- Worth: {!$File.Id}
- Row 1:
- Type Alternative Information
- Type Order: Descending
- Type By: Quantity
- How Many Information to Retailer:
- Choose Solely the primary document
- Learn how to Retailer File Knowledge:
- Select the choice to Robotically retailer all fields.
- Click on Performed.
In the long run, Jason’s Stream will appear to be the next screenshot:
Edge Communications account has 4 alternatives, and the Most worth is $100,000.
It’s time to Debug the movement and validate the outcomes:
Enterprise Use case II (MIN Operate)
Jason Herr is a Resolution Architect at Gurukul on Cloud (GoC). He needs to grasp the best way to discover the chance with the minimal quantity for a given account.
Automation Champion Method (I-do):
We are going to use a Get Information factor to resolve the above enterprise requirement. It doesn’t matter what sort of movement you’re engaged on, however the logic is identical.
Step 1: Outline Stream Properties
- Click on Setup.
- Within the Fast Discover field, sort Flows.
- Choose Flows, then click on on the New Stream.
- Choose the File-Triggered Stream possibility, click on on Create and configure the movement as follows:
- Object: Account
- Set off the Stream When: A document is created or up to date
- Set Entry Standards
- Situation Necessities: None
- Optimize the Stream For Quick Discipline Updates
- Click on Performed.
Step 2: Including a Get File Component to Discover the Minimal Alternative Quantity
The subsequent step is to make use of the Get Information factor to search out the minimal alternative quantity on a given account.
- On Stream Designer, click on on the +icon and choose the Get Information factor.
- Enter a reputation within the Label discipline; the API Identify will auto-populate.
- Choose the Alternative object from the dropdown listing.
- Choose All Situations Are Met (AND).
- Set Filter Situations
- Row 1:
- Discipline: AccountId
- Operator: Equals
- Worth: {!$File.Id}
- Row 1:
- Type Alternative Information
- Type Order: Ascending
- Type By: Quantity
- How Many Information to Retailer:
- Choose Solely the primary document
- Learn how to Retailer File Knowledge:
- Select the choice to Robotically retailer all fields.
- Click on Performed.
In the long run, Jason’s Stream will appear to be the next screenshot:
Edge Communications account has 4 alternatives, and the Minimal worth is $35,000.
It’s time to Debug the movement and validate the outcomes:
Enterprise Use case III (Rely Operate)
Jason Herr is a Resolution Architect at Gurukul on Cloud (GoC). He needs to grasp the best way to depend closed gained Alternative data for a given account.
Automation Champion Method (I-do):
We are going to use a Get Information factor to resolve the above enterprise requirement. It doesn’t matter what sort of movement you’re engaged on, however the logic is identical.
Step 1: Outline Stream Properties
- Click on Setup.
- Within the Fast Discover field, sort Flows.
- Choose Flows, then click on on the New Stream.
- Choose the File-Triggered Stream possibility, click on on Create and configure the movement as follows:
- Object: Account
- Set off the Stream When: A document is created or up to date
- Set Entry Standards
- Situation Necessities: None
- Optimize the Stream For Quick Discipline Updates
- Click on Performed.
Step 2: Including a Get File Component to Discover Out Closed Received Alternative
The subsequent step is to make use of the Get Information factor to get all alternative data the place stageName=Closed Received.
- On Stream Designer, click on on the +icon and choose the Get Information factor.
- Enter a reputation within the Label discipline; the API Identify will auto-populate.
- Choose the Alternative object from the dropdown listing.
- Choose All Situations Are Met (AND).
- Set Filter Situations
- Row 1:
- Discipline: AccountId
- Operator: Equals
- Worth: {!$File.Id}
- Click on Add Situation
- Row 2:
- Discipline: StageName
- Operator: Equals
- Worth: Closed Received
- Row 1:
- How Many Information to Retailer:
- Choose All document
- Learn how to Retailer File Knowledge:
- Select the choice to Robotically retailer all fields.
- Click on Performed.
Step 3: Including an Task Component to Discover Out the Variety of Rows in File Assortment Variable
The subsequent step is to search out out the document depend within the document assortment variable. For this, we are going to use an Task factor.
- Create a Quantity Variable varN_Count.
- Click on on the +icon and choose the Task factor on Stream Designer.
- Enter a reputation within the Label discipline; the API Identify will auto-populate.
- Set Variable Values
- Row 1:
- Discipline: {!varN_Count}
- Operator: Equals Rely
- Worth: {!Find_Closed_Won_Opportunity}
- Row 1:
- Click on Performed.
In the long run, Jason’s Stream will appear to be the next screenshot:
Edge Communications account has three closed gained alternatives.
It’s time to Debug the movement and validate the outcomes:
Enterprise Use case IV (SUM Operate)
Jason Herr is a Resolution Architect at Gurukul on Cloud (GoC). He needs to grasp the best way to decide the sum of closed gained alternative quantities for a given account.
Automation Champion Method (I-do):
We are going to preserve utilizing the movement we created for enterprise use case III. Let’s add two extra parts, Loop and Task, to calculate the summation.
Step 1: Add a Loop Component to Extract the Information from File Assortment Variable
- Create a Quantity Variable varC_SumOfAmount.
- On Stream Designer, click on on the +icon and choose the Loop factor.
- Enter a reputation within the Label discipline; the API Identify will auto-populate.
- For Assortment Variable, choose {!Find_Closed_Won_Opportunity}.
- For Specify Route for Iterating Over Assortment, choose the choice First merchandise to final merchandise.
- Click on Performed.
Step 2: Including an Task Component to Calculate the Sum of Alternative Quantity
- Beneath For Every Node, click on on the +icon and choose the Task factor on Stream Designer.
- Enter a reputation within the Label discipline; the API Identify will auto-populate.
- Set Variable Values
- Row 1:
- Discipline: {!varC_SumOfAmount}
- Operator: Add
- Worth: {!Loop.Quantity}
- Row 1:
- Click on Performed.
In the long run, Jason’s Stream will appear to be the next screenshot:
Edge Communications account has three closed gained alternatives price $225,000.
It’s time to Debug the movement and validate the outcomes:
Enterprise Use case V (AVG Operate)
Jason Herr is a Resolution Architect at Gurukul on Cloud (GoC). He needs to grasp the best way to decide the common quantity of closed alternatives for a given account.
Automation Champion Method (I-do):
We are going to preserve constructing the movement we created for enterprise use instances III & IV. Let’s add one system discipline to calculate the common.
Step 1: Method to Calculate the Common
- Click on New Useful resource to calculate the common quantity of closed gained alternatives.
- Enter the next data:
- Useful resource Sort: Method
- API Identify: forC_AverageAmount
- Knowledge Sort: Foreign money
- Method: {!varC_SumOfAmount}/{!varN_Count}
- Click on Performed.
In the long run, Jason’s Stream will appear to be the next screenshot:
Edge Communications account has three closed gained alternatives price $225,000. The typical quantity is $75,000.
It’s time to Debug the movement and validate the outcomes:
If the above resolution doesn’t be just right for you, I extremely suggest utilizing the Unofficialsf SOQL plug-in.
Formative Evaluation:
I wish to hear from you!
What’s one factor you discovered from this submit? How do you envision making use of this new information in the actual world? Be at liberty to share within the feedback under.
[ad_2]
Source link