Coalesce Function
Hello!
I have two fields on my opportunity that relate to who made a sale "Opportunity Owner" and "Enroller" ; the Enroller field is always the more true of the two fields though isn't always filled out so when I create a skuid report i want to be able to say
if enroller is blank use Opportunity owner otherwise use Enroller
this would be simple in Excel or using SQL though I am finding it difficult to do in skuid
Maybe I need to add a custom field on the opportunity - Thoughts?
I have two fields on my opportunity that relate to who made a sale "Opportunity Owner" and "Enroller" ; the Enroller field is always the more true of the two fields though isn't always filled out so when I create a skuid report i want to be able to say
if enroller is blank use Opportunity owner otherwise use Enroller
this would be simple in Excel or using SQL though I am finding it difficult to do in skuid
Maybe I need to add a custom field on the opportunity - Thoughts?
Tagged:
1
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
- IF ( {{Enroller}}, {{Enroller}}, {{Owner}} )
The actual field names inside the braces may be different. (I don't use standard objects, and the names you provided don't match what I see in the Opportunity object.)This way, you can use the UI-only field in a table or a field editor. If you only need this in a field editor,
you can accomplish the same with conditional rendering of the two fields: Enroller is not blank (for Enroller), and Enroller is blank (for Owner).
Basic Working
Aggregate not working
Formula used each time was IF(ISBLANK({{enroller2__c}}),{{Owner.Name}},{{enroller2__r.Name}})
enroller2__c ---> enroller2c
enroller2__r.Name ---> enroller2rName
Owner.Name ---> ownerName
you would do this:
IF(ISBLANK({{{enroller2c}}}),{{ownerName}},{{enroller2rName}})
Not really it didn't produce any results - i am not aggravating those fields by the way maybe i should have said this earlier. I am Opportunity Amount and grouping by the Opportunity Owner/Enroller fields would that change anything thing?
- Nope that didn't work by that i mean i got the formula to work in salesforce though its not showing up on the grouping area of the model - it shows up in the aggregations though thats not what I want
Here is the code
<model id="Yesterday_Sales_by_Owner" limit="20" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity" type="aggregate"> <fields>
<field id="Amount" name="sumAmount" function="SUM"/>
<field id="NewField" uionly="true" displaytype="FORMULA" ogdisplaytype="TEXT" readonly="true" returntype="TEXT">
<formula>IF(ISBLANK(enroller2rName),ownerName,enroller2rName)</formula>
</field>
</fields>
<conditions>
<condition type="fieldvalue" value="YESTERDAY" enclosevalueinquotes="false" field="CloseDate"/>
<condition type="fieldvalue" value="closed won" enclosevalueinquotes="true" field="StageName"/>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="Owner.FirstName" state="filterableoff" inactive="true" name="Owner.FirstName"/>
</conditions>
<actions/>
<groupby method="simple">
<field id="Owner_Enroller_combo__c" name="Owner_Enroller_combo__c"/>
</groupby>
</model>
I don't think you can do a Group By on a formula field in Salesforce. What I would do is create a Text field and add a Workflow rule to set the field with the name of the user from the lookup field that matches your criteria. You can 'group' a Text field.
Thanks,
Bill