My income statement requires a column for each department in our business. Each of my six departments have their own Sales, Cost of Sales, Gross Profit, Overhead, and Net Income.
The view from the database contains columns for GL Number, Department Number, and Amount for every transaction. I can tell if its Sales, Cost of Sales, etc from the identifying GL Number. I am able to get all of the pertinent information from one view, however I don't know how to arrange it on the report.
I created an initial version in Excel using the Sumifs function. How can I get the same arrangement of data in Crystal Reports?
Running Totals can be configured to only count records that meet given criteria. When creating the RT, select "sum" as the type of summary and "Use a Formula". In the "x-2" screen, write logic to filter out anything that doesn't meet the criteria you want.
Simple way would be group by report by GLNumber and place all fields that required sum in details and insert summary in group footer.
Related
Crystal reports don't let me use a custom count formula field to filter which transactions to show in a manager report.
I'm creating a Crystal report that team leaders are supposed to take out to see on how many occasions their employees have reported in sick. A record is only supposed to show if that person has reported in sick 6 or more times the last 12 months.
The report shows a record (a page) for each employee belonging to the managers organisational unit. Below the employee information is a subreport where I show the transactions from the salary/time system. Using select expert, I have filtered out the transactions that is supposed to show. I have then created a database field that count which day was 12 months back from today, and filtered so that only the transactions falling into this period shows.
My last problem is that I only want to show the record that has a minimum of 6 such transactions during the period. I created a formula field named #Antal ("amount" in Swedish) that simply counts the distinct number of dates in the "from"-date for the salary transactions I'm showing (since a change of law 2019-01-01 we needed to create a new transaction type, so some of the occasions after 2019 may have two transactions referring to one sick leave, thus I'm counting the first day of the period instead), DistinctCount ({P_LSTAT.P_SXXX06})
Now, the subreport has a new column with Antal (amount) that counts the amount of the desired salary transaction. I then try to use the selection formula to only show records where {#Antal} >= 6 but I get the following error:
This formula cannot be used because it must be evaluated later
Is there any other (better) way of doing this, or am I simply missing something?
For your selection based on {#Antal} >= 6 you need to use the group selection formula, not the record selection formula. Record selection is used to select records which meet the criteria before reading in the data. Group selection is used to filter out entire groups of records based on summarised values, after the records have been read in and the summaries calculated - which sounds like exactly what you need here.
The value of a Formula Field is out of scope when the Select Expert is evaluated.
There is no process for calculating the value of a Formula Field before it is printed within the section of the report it is placed. The Select Expert is evaluated prior to any section of the report being printed, so at this time all Formula Fields are effectively Nothing.
I tried looking for the answer but all the questions were more complicated, needing more complicated answers.
I'm trying to find the sum of a column in Crystal Reports, putting it into the footer, but when I do it gets a grand total that is totally incorrect. For example, i want to find the sum of the column balance, which has only got one row with £0.68, but CR puts £69.36. I have had to suppress the duplicates, so that probably has something to do with it, but since i'm new to everything code related I need some help.
The duplicate values you are seeing most likely are not a bug, but rather are data columns that have a many-to-one relationship with other data columns in a joined data table. Which is when grouping your data becomes necessary. For example, within a database one Invoice record typically joins with 1 or more Invoice Detail records. Each Invoice Detail record will have the same Invoice Number, and you will have duplicate Invoice Number values in your report. You say you begin by filtering your report to a single customer, but if that customer has more than one invoice, without a grouping level on Invoice Number, then the details section is the only place you can print the Invoice Number and it will duplicate over and over again for each item on the invoice that is defined on your Invoice Detail table. By grouping on Invoice Number you can use the group header section to print data fields that have a 1-to-1 relationship with any one invoice without duplicating them. Then you can use a summary field in the group footer section that properly reflects your grouped data without counting the duplicate values.
I'm trying to perform custom subtotaling on sales data to give a total for US and Non-US sales offices. My worksheet looks like the table labeled "current" and I am trying to make it look like the table labeled "desired result"
When I tried to group the sales centers as US and Non US the pill (dimension) was greyed out. After googling through a bunch of threads I found that grouping was not supported for secondary data sources. Is there anyway to do a manual calculation in the table calculations to add a row or do custom subtotaling?
Add a column for the country (assuming that you have the country in your data)
[see my example I had states and zip codes]
Then go to analysis > totals > check on show grand total and on add all subtotals
Visit Calculations totals - Grand total turn on for more information.
I have a fairly basic report that needs to show events with a total spend of >$200K OR event attendance >60ppl. The attendance portion is no problem, as it's a simple text field in the table. The expense spend is a field that has to be summed before it can be used, coming from a separate table with multiple entries per event. I have no problem doing this in a summary field dropped in the eventID header or even using a subreport and passing a shared variable to the main report. The problem I run into is that I cannot access this summary field in the report record selection to extract the either or records. Any idea how I can do this accurately?
Create a sql-expression field for total spending:
//{%total_spending}
(
SELECT sum(Amount)
FROM Meeting_Expenses
WHERE MeetingId=Meeting.Id
)
Use fields in record-selection formula:
{Meeting.actual_attendance}>60
AND {%total_spending}>200000
I'm working with a dataset where employee utilization is calculated as (Time Billed to X/Standard Billable hours). As such, to get the total billable percentage for an employee, I can just sum up the percentages billed to each client. However, I also want to be able to see the percentage of time billed by department.
I've currently got my data in a matrix with row groups Department-->Employee-->Client with 1 column group of "time sheet ending date". When I toggle the visibility of the client row group based on the employee row group, I get the correct totals at the client and the employee level. However, when I toggle the visibility of the employee row group based on the department row group, the department row group has the wrong totals. For example, if Department A has employee B with 90% utilization and employee C with 95% utilization, the toggled total at the department level is 185%....However, I am expecting to see 92.5%....any ideas????
You might just need to tweak the expression used to get the department total. I am unsure what expression exactly you used, but it should be of the form:
SUM(epmployeePercentageColumn)/COUNT(employeePercentageColumn)
obviously replace the "employeePercentageColumn" with whatever field or variable or expression that represents each of the employee percentages that come under the particular department.
If your current expression isn't in that form, try and tweak it.
Hope it Helps.