Salesforce Report Builder: Sorting by Grouped Total - salesforce

I have a pretty basic scenario: contacts have orders and orders have order line items. An order has a forumla field on it to calculate the entire cost of the order and that is working fine. I'm trying to create a report that shows each customer name and the summed dollar amounts of all orders for that customer. So I drag the customer name onto the fields area and then add the order total field. I group by the customer full name and then I set the group by on the order total column to sum and this works fine...but then I can't sort by that column. I want to sort by total dollar amount so I can quickly see who is a high buying customer. Is there a way to order a report by a summed field or will I just have to export to Excel and manipulate the data there?
Thanks
Josh

I'm sure that this is possible. I've recreated your scenario with the standard Opportunity object and the Amount field. I have grouped on both Opportunity Name and Amount. Clicking on the down arrow button on the group gives a menu that allows you to change the sort order of the group as shown in this image.
I think the fields in your report should behave in the same way.

Related

How could I only show the min in MS Access?

I am very new to access.
I tried to filter the data by using Totals and grouped the productPrice by min, however I get a range of all the product prices from min to max, here is a screenshot.
Also there is another column after MinOfproductPrice called storeName, I didn't include it for privacy reasons.
How could I make it so only the lowest price per product is shown? An example of what I am trying to do.
You could just do a summary query and do a group by with min (as you have done), but I suspect that the column you removed is to blame as it sounds like you want to be able to show that information as well.
There are a few ways to do this. In the first, you'll need to first create a summary query that gets just the product id and minimum price. Then, link this query back to your main table/query to get the additional columns like store, container, etc.
It is similar to finding just the most recent order row for each of your customers. The technique is the same. You can see a demo here:
https://youtu.be/5cnwHyn4dnI

Google Data Studio - Blended data Add non joined fields

I have one data set for campaigns from our marketing folks
CampaignID (PK)
CampaignName
CampaignDate
RecipientCount
I have another analytics data set from GA4
CampaignID (PK)
Opens
Clicks
Revenue
I want a report that has
CampaignID (PK)
CampaignName
CampaignDate
RecipientCount
Opens
Clicks
Revenue
I can join on the CampaignID and get Opens, Clicks and Revenue, but there doesn't seem to be a way to get other fields from the left table (CampaignName, CampaignDate, RecipientCount).
I was hoping I could add them as Metrics with aggregate Max(), but the only choice I have for non-numeric fields is Count and CountDistinct
If I add them as dimensions in the left table, need a matching dimension in the right table, so I made dummy fields with value NULL in the right table, but then the join fails. Seems the dimensions become join conditions.
Is there a way to get other non aggregate/join fields in the blended data set
Thanks
Mark
A metric field can be aggregated including min and max.
For a date timestamp in a metric, following options are possible:

Creating and Calculating Fields in Access

I've been working on an exercise for school that should have been rather simple. For some reason I cant quite figure out where I went wrong. I have been at it awhile so I may be overlooking something simple. I have some experience with data bases and actually implemented sqlite earlier today in an app but access is throwing me for a loop ! Any help is much appreciated.
Directions:
create a relationship between the tblEmployee table and the tblDepartment table as well as between the tblEmployee and the tblSale table. Be sure to enforce referential integrity in both relationships.
Create a query in Design view using the tblEmployee, tblProduct, tblSale, and tblSaleDetail tables. Add the First, Last, and Active? fields (in that order) to the query. Make the following changes to the query:
Display only active employees.
In the first empty column, calculate a new field, Total Sales (UnitPrice * Quantity) for each active employee.
Only display employees with more that than $300.00 in Total Sales.
Calculate a new field, Total Revenue (Total Sales – (Coupon * Quantity)) for each active employee.
Sum the UnitPrice, Quantity, Coupon, Total Sales, and Total Revenue fields.
Show First, Last, Total Sales, and Total Revenue in the query results.
Access Setup
When I run the query
Why is Total Sales not populated from that equation ?
Also, im a little unclear on where to add the > 300.00 to filter on employee sales.
The issue here isn't the total sales column, it is that you refer to a calculated field total sales when you create a column called total revenue.
Total Sales is only calculated once the query has been run, but total revenue wants to know what the value is before the query is run.
A workaround for this is to use the same calculation:
total revenue: ([Quantity]*[UnitPrice])-([coupon]*[quantity])
Another workaround is to create a query that calculates total sales. You can then insert that query into this one and use it as a subquery.
As for the ">300 for employee sales". I think the following may work:
I assume this is a monetary value by the 2 decimal places and not a 'number of sales' value. Therefore, I would add a new column.
SumOfSales: sum([tblSales].[quantity]*[tblSales].[UnitPrice])
Criteria: >300.00
Show: unticked

Creating a Batch Report

I am trying to create a batch report of multiple invoices using SSRS 2008 R2.
I have created the initial invoice report and have it set up with a parameter; the parameter uses an InvoiceID to populate the data within the invoice report.
I have created another report using lists, inside the list contains the information that was in my original invoice report but using a different parameter (BatchID). The problem I am running into with this is that instead of creating a single invoice for each invoiceID it is creating an invoice for each line item within each invoice. i.e.~ Instead of incorporating multiple items based on the InvoiceID (as the original report did) it is creating a report for each of the items.
What would be the best way of running a batch of these invoices? Am I going about this the wrong way or am I on the right track but missing something?
Thanks in advance!
SELECT i.InvoiceId, i.InvoiceNumber, i.BillTo_Line1, i.BillTo_Line2, i.BillTo_City, i.BillTo_StateOrProvince, i.BillTo_PostalCode, i.CustomerIdName,
i.ce_OutstandingBalance, i.ce_BillToDate, i.ce_BillFromDate, i.TotalAmount, id.ProductIdName, id.ce_customeridName, id.ce_CustomerProductName,
id.InvoiceDetailId, id.BaseAmount, id.PricePerUnit, id.ce_rate
FROM
Invoice AS i RIGHT OUTER JOIN
InvoiceDetail AS id ON i.InvoiceId = id.InvoiceId
Once I enter the invoiceID I get my report
My intent is to be able to run the report against multiple invoicesid numbers without having to select the invoice number itself. I have another table that collects the invoiceid's based on a batchid that they are run in.
So far I have attempted to create a subreport with the original report and Create a separate report that uses a list and attempt to group by InvoiceID for each batchid. Though with each of these I have so far been unsuccessful.
I am new to SSRS and have been pouring over documentation from MSDN about SSRS and the different abilities.
For this sort of repeating list, it's a matter of understanding how a list/grouping works.
Lists, Tables and Matrixes are all the same underlying object - the Tablix.
A List is a Tablix with one detail row (i.e. one Tablix row for each row in the Dataset), one textbox in that row, and a Rectangle in that textbox. The Rectangle can have various embedded elements like more textboxes and as such provides a repeating free-form item for each row in the Dataset.
You can see this when you create a List in the designer:
I assume your report query takes a BatchID and returns a number of invoices and their invoice details. I've taken some liberties with your data and created a simplified sample Dataset:
You want the Rectangle to repeat for every InvoiceNo. Currently the Row Group has no grouping item - change this to InvoiceNo under the Group properties and expand the Rectangle as required.
You can start adding in elements such as textboxes for the Invoice level items, something like:
Note that the left side of the Tablix has changed from lines to a bracket - this is because a grouping item was added to the Row Group.
This will repeat once for each InvoiceNo. Now we want to add the line items - you can do this by dragging a new Table into the Rectangle. Since we have a Row Group in place this table will only display items in that group:
When run for the sample data, this gives an ugly but functional repeating invoice report:
This could be tidied up as required, and page groups inserted between Group items in the Group properties as required.
Hopefully this at least gives you a rough idea of how you might go about your task.

How to manage changed items and their previous names in database

How does one handle situation when you have sales orders and items tables, and then at one point in time you have to change an item. The change will also show up on sales order that have that item. However, lets say that at the time the sales order was place the information was correct but changed later. I don't want older SOs to change what they show for line items and I don't want to have to make new items because it will confuse me later which item is correct.
I noticed that in OpenERP it does just that, keeps the name of part number and description on sales order even if you changed it after sales order was made.
If you are creating new database restructure your Item table. Create a table (for e.g. ItemHistory). have a ItemID and ItemTypeID and DateCreated Fields on it.
ItemID should be used for orders and ItemTypeID + DateCreated will help you to get the current Item.

Resources