Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Marc MaschinoMarc Maschino 
In the Lightning Experience Reports & Dashboard Specialist Superbadge, we are instructed to add a report template for custom objects in the "Other Reports category". I thought that meant a folder named Other Reports but I get the error

Challenge Not yet complete... here's what's wrong:
We can’t find your solution for users to report on custom objects named “SolarBots and Status Data,” or it's not stored in the correct place.


Since I've created the report, this implies it's not in the right place. I searched for categories in Setup's Quick Find & also as a record type when creating a new report, to no avail.

What am I missing?
Best Answer chosen by Marc Maschino
Jared HenningJared Henning
Hey Marc,

Sounds like it's a reference to creating a new report type. User-added image

When you are creating a new report type, you can choose which category to consider this type of report. You'll want to use this picklist:
User-added image

Then, when a user creates a new report, they are prompted to first choose a report type (sort of like a template, I guess). They would then be able to find the report type you created under the corresponding 'category' on the left.
User-added image
Hope that helps clear things up. Good luck!
Jennifer SchnellJennifer Schnell 
Looking for help on how to include the "Lead Status" field on a campaign member report that shows both leads and contacts.  I know these are seperate and have to run seperate reports - one for leads and one for contacts, but is there a way/work-around/custom field to get the "Lead Status" field to show up so we can see out of the leads which ones are still open, but also list any contacts in that same report that belong to the campaign?

Thanks.
Best Answer chosen by Jennifer Schnell
Steve MolisSteve Molis
Ouchie...  unfortunately those related lists can't be customized like "normal" Page Layout related lists.  You can customize the Campaign Member related list on the Campaign Page Layout, but not the Manage Campaign Members page,  for that you're probably looking at a cuastom Visualforce Page or (maybe) a 3rd Party App like Grid Buddy
Agata MatrasAgata Matras 

Hi 

I know that this has probably been talked over and over but I tried all different solutions to my problem and none of them seem to work =( 

I am trying to create a dashboard on which I can see the sizes of units we have avaliable and value of goods in each of them. 
 

I have created a summary report with 2 groups (unit size & value of goods) but when I try to put it into a dashboard I can only pick one of them as x-axis from drop down box, and the y-axis allowes me only to pick record count. 

Is it possible to have x-axis as unit size and y-axis as value of goods? If so a how to for dummy would be highly appreciated! 
 

Many thanks

Agata

Best Answer chosen by Agata Matras
David ReeceDavid Reece
When building reports or dashboards the charts work as follows:
The X - axis is the grouping (unit size)
The Y- axis is the column to total (value of goods)

You should not group by the value of goods but instead just have it as a field column on the report.
In edit mode of the report, click the drop down arrow beside the field name and click summarize, choose sum as the option in the pop up screen.

When you edit the chart, you should see the grouping in one axis, the column/field you summarized in the other axis.

Multiple groupings and multiple fields/columns summarized give you more choices for the chart.

Steve MolisSteve Molis 
Best practice tip:
Whenever you’re creating a Formula Field, Workflow Rule, Process Builder (or posting a Question about your Formula in the Answers Community), create a List View that includes all of the Fields that your Formula is evaluating side-by-side along with your Formula Field result (if it’s a Cross-Object Formula create a Report).  

Just because you clicked that Check Syntax button and you got that little green message saying “Congratulations!!!  No syntax errors in merge fields or functions. (Compiled size: 4998 characters)” doesn’t mean you’re home free. It just means you have the right combination of AND’s, OR’s, &&’s, ||’s, etc. you could still have a flaw or loophole in your Formula Logic.  

If you think getting a Syntax Error sucks, just wait’ll you have to explain to your boss why their Pipeline and Forecast Reports and Dashboards are wrong because you didn’t check the results of that shiny new Formula Field you built.
 
[Insert Winston Wolfe’s parable about premature self-congratulation]
https://www.youtube.com/watch?v=mxuHYVmWlmU

Formula with QC List View
User-added image
User-added image


Cross-Object Formula with QC Report
User-added image
User-added image


 
Best Answer chosen by Steve Molis
adam marksadam marks
Steve, please make sure to mark a best answer! #keepourcommunityclean!


(that felt so ditry to type)
Aniqa MoinuddinAniqa Moinuddin 
Does anyone know how I can define a formula that returns Monday/Tuesday/Thursday etc from a date field? The only formula I can think of requires that I define a variable ( Sunday = Day (Date expression) + 7x; where x= integer between 0 and infinity)

Thanks!
Best Answer chosen by Moderator (salesforce.com) 
Sami EllongSami Ellong
Try this:

CASE( MOD( Date__c - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3,
"Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Error")
Mary O'DonovanMary O'Donovan 

I am getting stuck on the hands on challange Customize Record Highlights with Compact Layouts, getting error message Challenge Not yet complete... here's what's wrong: Could not find a compact layout with the label 'New Oppty Compact Layout'.

challange is
Create a custom Opportunity compact layout
When the Ursa Major Solar salespeople are on site with a customer, there are a few key fields they need to see right at the top of an opportunity record when they access Salesforce. Create a compact layout that will help them do that.

Create a new compact layout for the Opportunity object with the label New Oppty Compact Layout
Include these fields, in this order: Opportunity Name, Probability (%), Close Date, Stage, Amount, Opportunity Owner
Make it the primary compact layout

I know i am proberly missing something quiet basic but cannot see what it is.
Thanks for some help

 

Best Answer chosen by Ed (salesforce.com) 
Ryan WayRyan Way
Ms White, 
I did the same thing! You are in the wrong area though, that was where you needed to be for the example Create a Compact Layout section. For the challenge, everything is about the same except this:

User-added imageUser-added image

Hope that helps ! 
Steve MolisSteve Molis 
Here's a Formula I built to create an "Ultimate Parent Account" field that you can use to create Opportunity Pipeline reports that roll up all Opportunities under the top Account in the hierarchy. 

*** in this example I'm testing up to a 5 Tier Account Hierarchy (Compiled size: 342 characters) ***

Datatype: Formula 
Result: TEXT 
Formula: 
 
IF(NOT(ISBLANK(Parent.Parent.Parent.Parent.Parent.Name)), Parent.Parent.Parent.Parent.Parent.Name,
IF(NOT(ISBLANK(Parent.Parent.Parent.Parent.Name)), Parent.Parent.Parent.Parent.Name,
IF(NOT(ISBLANK(Parent.Parent.Parent.Name)), Parent.Parent.Parent.Name,
IF(NOT(ISBLANK(Parent.Parent.Name)), Parent.Parent.Name,
IF(NOT(ISBLANK(Parent.Name)),Parent.Name,
Name)))))

 
Best Answer chosen by Miglena (Salesforce.com) 
Steve MolisSteve Molis
An #AWESOME bonus tip from @Jeremiah Dohn to turn the Ultimate Parent into a Hyperlink to that Account

Datatype: Formula 
Result: TEXT 
Formula: 
 
HYPERLINK('/' + 
IF(NOT(ISBLANK(Parent.Parent.Parent.Parent.Parent.Name)), Parent.Parent.Parent.Parent.Parent.Id, 
IF(NOT(ISBLANK(Parent.Parent.Parent.Parent.Name)), Parent.Parent.Parent.Parent.Id, 
IF(NOT(ISBLANK(Parent.Parent.Parent.Name)), Parent.Parent.Parent.Id, 
IF(NOT(ISBLANK(Parent.Parent.Name)), Parent.Parent.Id, 
IF(NOT(ISBLANK(Parent.Name)),Parent.Id, 
Id))))), 
IF(NOT(ISBLANK(Parent.Parent.Parent.Parent.Parent.Name)), Parent.Parent.Parent.Parent.Parent.Name, 
IF(NOT(ISBLANK(Parent.Parent.Parent.Parent.Name)), Parent.Parent.Parent.Parent.Name, 
IF(NOT(ISBLANK(Parent.Parent.Parent.Name)), Parent.Parent.Parent.Name, 
IF(NOT(ISBLANK(Parent.Parent.Name)), Parent.Parent.Name, 
IF(NOT(ISBLANK(Parent.Name)),Parent.Name, 
Name))))))

 
Evan PonterEvan Ponter 
I've figured out a workaround for those interested in grouping report results by a date field and want to count the number of "groups" between the highest date value and the lowest date value, inclusive. This also includes any groupings in between those date values that aren't showing any records (desirable in some situations, not all. Just something to be aware of). While this isn't truly counting "the number of groups that you see in your report", it does work for a lot of situations where you have sequential groups of dates with data - e.g. records with January, February, and March dates on them and your report time frame is set to only show January, February, and March.

I will point out that Salesforce might be developing something to address this natively (https://www.salesforce.com/blog/2019/02/ideaexchange-formulas-dates.html). They mention that:
[The] team paired the two ideas together when scoping the feature, which helps report users organize and summarize data to answer questions such as:
  • When was the last time we contacted a customer?
  • How long, from the project start date, did it take to close an opportunity?
  • What’s the average number of records created within a given timespan?
The article goes on to say:
The initial beta functionality for the Summer ‘19 release will allow comparisons via date/time functions, and is currently in development for the Lightning Experience. Additional functions will be supported upon the general availability of the feature, planned for the Winter ‘20 release.

Which sounds like we should cross our fingers for a Winter '20 release. Until then, try this out:

You will need to create a formula field to correspond with the time frame for your group (see #1 below). This formula field assigns a number sequence to the record based on the date field. The starting number and actual values are arbitrary - this just needs to be a sequential series of numbers that are consistent for all records on the object so that you can calculate a difference between two records.

1. Create a formula field on the object in question.
Formula Field

Use the "number" data type with no decimal places.
Number Formula Options

Anything surrounded by brackets [ ] (including the brackets) needs to be replaced with your value.

- - - 1a. For fiscal year groupings, name the field "Fiscal Year of [date field name]" and use this formula. I'm using a fiscal-year-ending model here. You may want to use fiscal-year-beginning if your organization does so that there's no confusion (see below the code snippit), but it really doesn't matter since we are interested in the difference between two records. Also, I recommend storing your fiscal year start month and start day in custom settings so you don't hardcode those values here:
YEAR([date_field_API_name])
+
IF(
    MONTH([date_field_API_name]) > [Fiscal Year Start Month]
    ||
    (
        MONTH([date_field_API_name]) = [Fiscal Year Start Month]
        &&
        DAY([date_field_API_name]) >= [Fiscal Year Start Day]
    ),
    1,
/*ELSE*/
    0
)
For Fiscal Year Beginning, swap the plus sign for a minus sign on line 2, then swap the 1 and 0 on lines 10 and 12

- - - 1b. For calendar year groupings, name the field "Year of [date field name]" and use this formula:
YEAR([date_field_API_name])

- - - 1c. For calendar quarter groupings, name the field "Sequenced Quarter of [date field name]" and use this formula (works for fiscal quarters too as long as your fiscal months start on Jan 1, Apr 1, Jul 1, and Oct 1 - e.g. your fiscal year starts on Apr 1 and you have 3-month quarters resulting in fiscal months starting on Apr 1, Jul 1, Oct 1, and Jan 1):
IF(!ISBLANK([date_field_API_name]),
    CEILING(MONTH([date_field_API_name]) / 3)
    +
    4 * YEAR([date_field_API_name]),
/*ELSE*/
    NULL
)

- - - 1d. For calendar month groupings, name the field "Sequenced Month of [date field name]" and use this formula (works for fiscal months too as long as your fiscal months start on the 1st of each calendar month - e.g. Apr 1, May 1, Jun 1, etc):
IF(!ISBLANK([date_field_API_name]),
    MONTH([date_field_API_name])
    +
    12 * YEAR([date_field_API_name]),
/*ELSE*/
    NULL
)

- - - 1e. For calendar week groupings, name the field "Sequenced Week of [date field name]" and use this formula. This is for Sunday - Saturday weeks. To change which day of the week you want to start on, see below code snippit. I chose January 1, 1905 as my magic date because it's the beginning of a year pretty far in the past that falls on a Sunday. Even if your date value is before January 1, 1905, the calculations will still work since we are only concerned with the difference between two records:
IF(!ISBLANK([date_field_API_name]),
    FLOOR(([date_field_API_name] - DATE(1905,1,1)) / 7,
/*ELSE*/
    NULL
)
To start the week on Monday, replace line 2 with:
FLOOR(([date_field_API_name] - DATE(1905,1,2)) / 7,

To start the week on Tuesday, replace line 2 with:
FLOOR(([date_field_API_name] - DATE(1905,1,3)) / 7,

To start the week on Wednesday, replace line 2 with:
FLOOR(([date_field_API_name] - DATE(1905,1,4)) / 7,

To start the week on Thursday, replace line 2 with:
FLOOR(([date_field_API_name] - DATE(1905,1,5)) / 7,

To start the week on Friday, replace line 2 with:
FLOOR(([date_field_API_name] - DATE(1905,1,6)) / 7,

To start the week on Saturday, replace line 2 with:
FLOOR(([date_field_API_name] - DATE(1905,1,7)) / 7,

- - - 1f. For daily groupings, name the field "Sequenced Day of [date field name]" and use this formula:
[date_field_API_name] - DATE(1905,1,1)


2. In your report, create a custom summary formula.
To calculate the date groupings between the highest date and lowest date, specify the MAX of your formula field from #1 above, then subtract the MIN of your formula field from #1 above, then add 1 (since we want to count both the first and last group, not just what's in between).
[YourObjectHere].[YourNewSequenceFieldHere]:MAX
-
[YourObjectHere].[YourNewSequenceFieldHere]:MIN
+
1
Here's my example - I want to know how many "week" groups are in my report (Just for demo purposes to prove this method is calculating the right number):
Custom Summary Formula Counting Weeks
(this can be displayed at all levels or only at the grand total level)

Here's what it calculates when you run the report:
Report Showing Number of Weeks

Then here's a formula to calculate Average Number of Records per Week:
RowCount
/
(
    [YourObjectHere].[YourNewSequenceFieldHere]:MAX
    -
    [YourObjectHere].[YourNewSequenceFieldHere]:MIN
    +
    1
)
Display this at the grand total grouping only. You should see an accurate average calculation that takes into account how many date groupings you have in your report. Here's what mine looks like:
Average Records per Week

Hope this helps anyone out there trying to calculate something similar in their reports. Comment below with suggestions for improvement, or to celebrate when Salesforce builds this in natively.

Shout out to SteveMo for suggesting I post this. Also his tweet (https://twitter.com/SteveMoForce/status/1130904510833090560) was my motivation to buckling down on this endeavor
Best Answer chosen by Evan Ponter
Evan PonterEvan Ponter
Couple of improvements since I wrote this. Here are revised formulas for step 1. PLUS a few bonuses...


1a "Fiscal Year of [date field name]"
For consistency, this should only resolve to a value if there is a date in your date field.

I'm using a fiscal-year-ending model here. You may want to use fiscal-year-beginning if your organization does so that there's no confusion (see below the code snippit), but it really doesn't matter since we are interested in the difference between two records. Also, I recommend storing your fiscal year start month and start day in custom settings so you don't hardcode those values here:
IF(!ISBLANK([date_field_API_name]),
    YEAR([date_field_API_name])
    +
    IF(
        MONTH([date_field_API_name]) > [Fiscal Year Start Month]
        ||
        (
            MONTH([date_field_API_name]) = [Fiscal Year Start Month] 
            &&
            DAY([date_field_API_name]) >= [Fiscal Year Start Day]
        ),
        1,
    /*ELSE*/
        0
    ),
/*ELSE*/
    NULL
)
For Fiscal Year Beginning use:
IF(!ISBLANK([date_field_API_name]),
    YEAR([date_field_API_name])
    -
    IF(
        MONTH([date_field_API_name]) > [Fiscal Year Start Month]
        ||
        (
            MONTH([date_field_API_name]) = [Fiscal Year Start Month] 
            &&
            DAY([date_field_API_name]) >= [Fiscal Year Start Day]
        ),
        0,
    /*ELSE*/
        1
    ),
/*ELSE*/
    NULL
)


1b "Year of [date field name]"
For consistency, this should only resolve to a value if there is a date in your date field.
IF(!ISBLANK([date_field_API_name]),
    YEAR([date_field_API_name]),
/*ELSE*/
    NULL
)


1c. "Sequenced Quarter of [date field name]"
No changes needed. Same description from above:

For calendar quarter groupings, name the field "Sequenced Quarter of [date field name]" and use this formula (works for fiscal quarters too as long as your fiscal months start on Jan 1, Apr 1, Jul 1, and Oct 1 - e.g. your fiscal year starts on Apr 1 and you have 3-month quarters resulting in fiscal months starting on Apr 1, Jul 1, Oct 1, and Jan 1):
IF(!ISBLANK([date_field_API_name]),
    CEILING(MONTH([date_field_API_name]) / 3)
    +
    4 * YEAR([date_field_API_name]),
/*ELSE*/
    NULL
)


1d. "Sequenced Month of [date field name]"
No changes needed. Same description from above:

For calendar month groupings, name the field "Sequenced Month of [date field name]" and use this formula (works for fiscal months too as long as your fiscal months start on the 1st of each calendar month - e.g. Apr 1, May 1, Jun 1, etc):
IF(!ISBLANK([date_field_API_name]),
    MONTH([date_field_API_name])
    +
    12 * YEAR([date_field_API_name]),
/*ELSE*/
    NULL
)


1e "Sequenced Week of [date field name]"
This should really be using the MFLOOR function to handle dates before January 1, 1905. Plus my original post was missing a parenthesis on line 2 (oops!!). Use this instead for a Sunday - Saturday week:
IF(!ISBLANK([date_field_API_name]),
    MFLOOR(([date_field_API_name] - DATE(1905,1,1)) / 7),
/*ELSE*/
    NULL
)
Here's line 2 for a Monday - Sunday week:
MFLOOR(([date_field_API_name] - DATE(1905,1,2)) / 7),
Here's line 2 for a Tuesday - Monday week:
MFLOOR(([date_field_API_name] - DATE(1905,1,3)) / 7),
Here's line 2 for a Wednesday - Tuesday week:
MFLOOR(([date_field_API_name] - DATE(1905,1,4)) / 7),
Here's line 2 for a Thursday - Wednesday week:
MFLOOR(([date_field_API_name] - DATE(1905,1,5)) / 7),
Here's line 2 for a Friday - Thursday week:
MFLOOR(([date_field_API_name] - DATE(1905,1,6)) / 7),
Here's line 2 for a Saturday - Friday week:
MFLOOR(([date_field_API_name] - DATE(1905,1,7)) / 7),


1f "Sequenced Day of [date field name]"
For consistency, this should only resolve to a value if there is a date in your date field.
IF(!ISBLANK([date_field_API_name]),
    [date_field_API_name] - DATE(1905,1,1),
/*ELSE*/
    NULL
)


AND NOW INTRODUCING...
1g "Sequenced Business Day of [date field name]"

That's right, claiming the 1g spot is the "Sequenced Business Day of [date field name]" field. This will allow you to count the number of Business Days (Monday - Friday) in your report. You are still creating a number field with no decimal places, and you'd use this formula:
IF(!ISBLANK([date field name]) && WEEKDAY([date field name]) > 1 && WEEKDAY([date field name]) < 7,
    (MFLOOR(([date field name] - DATE(1905,1,1)) / 7) * 5)
    +
    WEEKDAY([date field name]),
/*ELSE*/
    NULL
)
Saturdays and Sundays will evaluate to a null value - which means they will be ignored completely even if they appear in your report. The weekdays will each be numbered in sequence. I checked this one for syntax, dates before 1/1/1905, etc so it should be an easy copy-and-paste for you. Then follow step 2 from the original post to create the custom summary formula in your report.


BONUS TIP 1:
You don't need to group your report results by the timeframe you are averaging. Confused? Here's my example. I am calculating the average number of records per week and I want to know that "weekly average" for a time frame spanning the whole fiscal year. I don't need to group my report results by week, only by fiscal year. The custom summary formula will take care of calculating the correct averge for each fiscal year, and the overall time frame in the total column
Average Per Week for Fiscal Years


BONUS TIP 2:
When using multiple groupings, you can use the custom summary formula as-is to find the difference between the maximum and minimum dates in each grouping, or use the PARENTGROUPVAL function to get the maximum and minimum dates from a higher grouping. This allows you to factor in the entire timeframe regardless of the data present in each grouping.

This example is for a report with row and column groupings (formerly known as a Matrix Report). This will need to be displayed at a grouping level (in my case Hostel/Community for the row and Start Date for the column).
RowCount
/
(
    PARENTGROUPVAL([YourObjectHere].[YourNewSequenceFieldHere]:MAX, ROW_GRAND_SUMMARY, [YourColumnGroupingFieldHere])
    -
    PARENTGROUPVAL([YourObjectHere].[YourNewSequenceFieldHere]:MIN, ROW_GRAND_SUMMARY, [YourColumnGroupingFieldHere])
    +
    1
)

There have been 9 weeks in FY 2020. Austin had a record each week, their average per week is 1. Nice.
Eastham had a record in each of the first 3 weeks, but none after that. The calculation for Eastham uses 3 as the numerator (the number of records for that group) and 9 as the demoninator (which is taken from the row grand summary for that column) and results in 0.33. For the completed years, each hostel is getting an average calculated based on a 52-week year regardless of having records in the first and last (or any) week of that year.
Average per Week for Entire Time Frame
Kimberly DyKimberly Dy 
Hello,

We have text messages sent to our customers and our customers send text messages back to us which is recorded in SFDC; specifically in the activity history. We have the field "activity type" where we added 2 values "Inbound SMS" and "Outbound SMS". We'd like to capture the percentage of incoming SMS divided by outbound SMS in a report. 

Currently, the issue I'm having is not being able to divide Inbound SMS/Oubtound SMS. Instead, the formula I have in the report is Inbound SMS/Total record count (inbound and outbound). Does anyone know how I can get the % of engagement base on the inbound records/ outbound records? 

 
Best Answer chosen by Kimberly Dy
Sunil SarillaSunil Sarilla
Hi Kimberly,
You can get it done by creating one field or by 2 fields, if creating 2 custom fields is not a problem you can do the below.
are you sure the Activity Type is the standard Type field because the field API name that you have provided is Activity_Type__c which indicates its a custom field.
ok assuming its a custom picklist field
Please create a custom formula field and Name it Count of Inbound SMS
and the formula is simply
IF(TEXT(Activity_Type__c) = "Inbound SMS",1,0)
Create a 2nd Custom formula field and name it Count of Outbound SMS and the formula is
IF(TEXT(Activity_Type__c) = "Outbound SMS",1,0)
Now on your report (it has to be either Summary or Matrix)
Create a Custom Summary formula field
Give a Name to your Column
Format: Percent and the formula will be
Activity.Count_of_Inbound_SMS__c:SUM/
Activity.Count_of_Outbound_SMS__c:SUM/
Please click on summary fields to select the Count of Inbound SMS and outbound SMS field

If the field is a Standard "Type" field, then the solution will differ a lot as you cannot reference a Type field in a direct formula and you will need custom number fields (insttead of formula fields) and then use workflow to update the field(s)
 
Brian StoiberBrian Stoiber 
I have a matrix report on Opportunities that come from partners of ours. I want to perfrom a calculation on the number of Closed Won over the total to see what percent result in a sale. I am struggling with how to create that row level formula. 

User-added image

This is a very small sampling so at this point, it would result in:
Line 1:   2 / 2 = 100%
Line 1:   2 / 2 = 100%
Line 1:   1 / 1 = 110%
Line 1:   0 / 1 = 0%
Line 1:   1 / 1 = 100%
Total:      6 / 7 = 85.71%   <--- if possible. Not a requirement.

If I need to change the format of the report, I can do so as well. I just thought a matrix would lend to an easier time doing so. 
Best Answer chosen by Brian Stoiber
Steve MolisSteve Molis
I just used 
WON:SUM / CLOSED:SUM

that's all