Surely Salesforce supports regular old grouping and summarization in reports? - reporting

So the reporting system in Salesforce is a bit restricting. It seems there is no editor for an xml or other markup language to create reports in; apart from formulas you're stuck in the website drag and drop ui.
There seems to be 3 types of reports in Salesforce Tabular, Summary and Matrix. The first kind is kind of useless for more advanced reports, since it doesn't support forumulas (if both fields are in the same table you can work around this with calculated fields). However with all 3 I've found it difficult to impossible to make a report with basic details and summarized figures.
An example:
I've added a custom field "company size" to the Account table/object. This tracks the approximate number of employees working at the customers company (ever taken one of those surveys that asked you for a range of how many employees worked in your organization). I then have a custom table/object for sales, listing the account, the date and the volume ($).
I would think it would be a simple to create spreadsheet style report with each row listing an account, which state it was based in, how many employees they had, followed by their total sales and sales/employee (a formula of volume/employees).
But the grouping and summarization options don't seem to work that way. Grouping in both the Summary and Matrix report types seems to want to treat each grouped field as a seperate level, so with the 3 fields related to the account I get 3 cascading fields in a stair like arrangement, instead of being able to put them on one row.
It gets worse with the summarization - no matter what I and other colleague have tried the summarization doesn't seem to work. If an account has 50 sales we end up with 50 rows, even if we click the little arrow beside the column, click summarize and check Sum.
From an SQL perspective this report seems like something you would teach students in the first week, yet its really not obvious how translate this into something Salesforce can understand. A lot of the web ui is not discoverable (dragging fields provides no feedback as to why it can't be dropped in a particular place, some options are hidden unless you hover the mouse over the right place) so I would not be surprised if I've missed a crucial step.
So, is there an option to make this work (particularly getting sales to be totaled as a single cell for each account, not 2 or 5 or 50), maybe a distict checkbox lurking behind an innocent blank area?

Given the lack of calculated fields in the report, you need to create the formula at the object level. If it's not useful in the detail page, don't include it in the page layout. It will still be available in reporting.
The summarization/grouping options work as in SQL, but you can only group by one field at a time.
However, the result view in "show details" mode is not like a simple SQL query - more like using windowing functions where the result output can contain both groupings with aggregations at those levels, and the detail rows that fed into that grouping.
In "hide details" mode, the detail rows are not shown, and so only grouping levels and the aggregates are shown.
So, it looks like you can either:
group by state, then account, sum your employees, sum sales, and then a Custom Summary formula of sum:sales/sum:employees
or
create a formula field on account to do sales/employees
tabular report with fields of: account, state, employees, sales, your new field.
Also, if you want an XML editor, you can edit the XML for reports (as with many other parts of salesforce setup) via the metadata API and the force.com plugin for eclipse. But it's mainly for tweaking reports, or version control, or mass-actions, as there is no preview/run operations, it's mostly a metadata management system.

Related

Sum Opportunity Line Quantity Dynamics CRM

I have a list of opportunity product lines associated to the opportunity. The products in the opportunity lines are labor based, engineering services. For projecting resource requirements I want to add two fields to my opportunity entity.
Total Labor Effort
This field would be populated by the total quantity of all "labor based" products in the opportunity product lines.
Weighted Labor Effort
Same as Total Labor Effort, except the value will be multiplied by the probability of closing the deal. This is a separate custom field in the opportunity.
I have tried a roll up field, but I can't seem to get it to sum up the quantity of the products in the product lines. It will only look at the product lines themselves. Calculated field seem to be more limited even.
What features of Dynamics CRM could help me achieve this?
If I could add my 2 cents,
There is indeed rollup field limitation here.
Now I could sense 2 ways to achive this.
Dynamics-365-Workflow-Tools
Reason been, this is well documented and up to date with latest CRM Version and especially fucntion query Values
If you don't want to add overhead of adding any 3rd party solution may it be free of cost, I would move my logic to Plugins i.e custom c# code to perform operations (server side)
I personally would go for custom code, you have more control of what you want to achieve there.
I recommend using Kaskela Workflow Elements, a free workflow extension that can query the opportunity products and return the number of line items: https://kaskelasolutions.com/current-query-get-results/
After you import Workflow Elements, you will need two workflows:
1. one that is started whenever a product line item is created /modified/deleted and it will update a "trigger" field on the opportunity, such as a "date detail changed"
2. one on the Opportunity that will count the detail lines.
In the 2nd workflow, use the "Query - Get Results" feature
You will need to create a FetchXML query to get the Opportunity Line items - you can use Advanced Find to create the query. This looks a bit strange because you create the query using the child records and link back to the parent opportunity, but this is how Kaskela filters the results to just the Opportunity Lines that are related to the opportunity.
The next step in your workflow is to insert the results into the opportunity record:
Ultimately I solved this using MS Flow to retrieve all the Opportunity Line from an "updated" Opportunity and summing them up before finally writing to the Opportunity field. For weighted value I made a simple calculated field based on the close probability and total labor effort.
MS FLow Screen Shot

APEX_ITEM displays only one row

I have created a form region "Form on a SQL query" with this query
SELECT
APEX_ITEM.TEXT(1,TEAM_MEMBER) TEAM_MEMBER,
APEX_ITEM.TEXT(2,HOURS) HOURS
FROM APEX_TEAM_MASTER
WHERE TEAM_DATE = :P2_TEAM_DATE
AND UPPER(TEAM_LEAD) = UPPER(:P2_TEAM_LEAD)
ORDER BY 1
TEAM_MEMBER and HOURS are the exact columns in the APEX_TEAM_MASTER table
The :P2_TEAM_DATE and :P2_TEAM_LEAD are select lists. When i run the page and select values in the lists, the form displays just one row of text boxes.
The purpose of this page is, a manager can login to this application, select a date and a team lead under him, which lists the members under the lead. He can then record the hours each team member worked for the day. There are multiple team leads under each manager and different number of team members under each team lead. So the form has to be dynamic.
What you described looks more like an Interactive Grid (IG) (or former Tabular Form). There's no need for you to reinvent that functionality, so - switch to the IG and let Apex take care about everything else.

Where can I find sold item notes in the Square API?

I'm trying to create a report to pull my Square POS transaction data into Excel through Power Query. Basically, I want the information available in the standard "Items Detail CSV" report found in the Square Dashboard, but connected to Excel so I can build custom reporting and update it any time with a refresh.
I can connect to the Square data in Excel no problem. What I'm having trouble with is finding the right data, specifically the notes the merchant can enter in during the time of sale about the item. We have several items that will come up as "Custom Amount" where we enter additional notes about the item, and I can't find the notes field through the API.
After looking through the documentation, I've tried two main queries:
The Transactions List from v2:
https://connect.squareup.com/v2/locations/{location_id}/transactions
The Payments List from v1:
https://connect.squareup.com/v1/{location_id}/payments
The Payments List includes the v1PaymentItemization data type, which should include the notes field defined as "Notes entered by the merchant about the item at the time of payment, if any." I assume that's what I'm looking for.
(Link to documentation: https://docs.connect.squareup.com/api/connect/v1#type-v1paymentitemization)
However, I cannot find the notes field anywhere in my pulled results. There are no error messages, and I see every data field listed in the v1PaymentItemization documentation except "notes" in my query results.
Edit: The notes we're using are on individual items, not the payment as a whole. This fits the description of V1 List Payments -> PaymentItemization -> notes. I did check the tender notes as mentioned in the comments, but this was not what I'm looking for. Until now, I wasn't aware we could make a comment on the transaction as a whole, as opposed to individual items. The individual items notes would be more helpful anyway.
Either way, I didn't find the tender notes in the pulled data either. Most of the fields are there in the data pull, but not notes, v1TenderEntryMethod, and a couple of others. There's actually more data available in the standard dashboard reports than is actually pulling from the API.
I do realize a workaround is to export the Item Detail CSV report from the Square Dashboard, and then manipulate the data in Excel from there. I could even have a connection to the folder or file where I save my exports. It's just not as smooth as the desired result of opening Excel, setting my parameters there, and clicking refresh to get the data and formatted report all in one place.
Thanks
Second Edit: In the POS, I'm entering an amount which shows up as Custom Amount in the itemized list for the sale. I then click on the Custom Amount to add a note to it and specify what the item is (e.g., "Lamp"). That note is applied to a single item, and there may be several items per transaction that have these notes added to them which would otherwise only show as "Custom Amount" on a report or receipt. We do this because we sell several items that are not standard inventory items, but we do want to keep track of what we've sold.
I can see these notes for each item in the standard reporting, so I know the data is entered and saved correctly. However, I can't find the note field when I pull from the API. I see all of the other itemization fields (i.e., name, quantity, item_detail, itemization_type, etc.), but not the note field.
I'm getting these results with a simple /v1/payments pull with no parameters or filters.

create views in filemaker

I am trying to make something like this in Filemaker Database views.
The database will contain employees and projects. There need to be two combined views. One displaying the list of employees and which projects they are on in which week and by which percentage. The other one displaying the list of projects and which employees are on it in which week by which percentage. For each employee and each project there need to be a sum of percentages for all assigned projects / employees.
I have made three tables in my database:
employee
projects
employee_on_projects
Now I want to create these views. Can anybody tell me how to do this from scratch?
Thanks in advance.
FileMaker is not a good tool for creating cross-tab reports, as it has no native functionality to build these. It has to be done manually. Do a search on cross tab reporting in FileMaker and you will get some ideas.
Traditionally you need relationships and fields to hold and display your data.
On the top of my head, in this case I would probably use merge variables for displaying progress and other calculated data to avoid having fields for all those weeks. A script would gather the data using ExecuteSQL and calculate the variables. The whole thing could even be generated in HTML and displayed in a web viewer.
This way you should get away without too many relationships and fields.
If you want a simpler, but more cluttered solution, you could go with regular fields for all 53 weeks and use a sub summary report. Each field could be set up with ExecuteSQL if possible, to avoid having a relationship for each period.

Cognos Report-need 2nd (Totals) Crosstab that is "aware" (filters) using the current Grouping

I am trying to create a report which groups on a column called "Legal Entity." When the output is directed to Excel, a separate tab will be created for each distinct entity in the query resultset.
For each Excel tab/Legal Entity, there will be two "sections." The first is a repeating section that breaks on a column "Funding Arrangement Type." After all of the Funding Arrangement Types are exhausted, there will be a single "Totals" grid which will summarize the data on the tab for the current Legal Entity. The data will be summarized across all Funding Arrangement Types within the current Legal Entity.
Because the Totals (lower) grid is really just a summarization of the same source query, Query1, I thought that I would also bind the Totals grid to it. However, if I do that, I get a run time error that tells me that I need to establish a Master-Detail relationship (If I decide to use a separate query for the Totals grid, the Totals grid "will not be aware" of the current Legal Entity/tab that must be considered when summarizing.)
Therefore, I continued with my guess at how the Master-Detail relationship should be defined. I made various attempts to link the two grids, including:
On all of the dimension (non-summarized) columns.
On Legal Entity
On Legal Entity and Funding Arrangement Type
Doing so affected previously correct totals reported in the upper cross tab results/
This Master-Detail approach is foreign and as a result I don't understand what it is doing.
I also tried to use a separate query, Query2, for the lower totals grid and adding a filter to filter SQL2 where SQL2. LegalEntity = SQL1.LegalEntity in an effort to get the totals grid to summarize within the current LeglEntity grouping. This resulted in a cross join error.
I’m a real noob with Cognos. Suggestions are welcomed. Thank you!
You can use mouse+scroll wheel to zoom in:
I was able to get it working by binding both grids to a single query and for both grids, establish a Master-Detail Replationship on Legal Entity. Prior to doing that, I added these columns to both grids and hide them, not sure if this was necessary.

Resources