I created a simple report that has 5 columns (CompanyName, Bought, Sold, Returned, Total)
This is what it looks like.
CompanyName Bought Sold Returned Total
With the exception of the Company Name, every value is a number. I created simple queries for Bought, Sold and Returned. For Total I used arithmetic in the main query (basically the sum of Bought, Sold, Returned (Returned is always negative)). The problem I came across is that for some companies, some of the columns (Bought,Sold,Returned) are NULL since ex: they don't have any RETURNED so when I run the report, it doesn't show me any value for TOTAL. Unless I have values in all three(BOUGHT SOLD and RETURNED) - nothing gets displayed in TOTAL. I don't want to display any zeros in the report itself because it would be too clustered, but is there a way for me to convert the NULL to 0 only when it does the calculation and but hide it from the report?
Related
New to SSRS.
I have created some parameters. however...
I am trying to create a count parameter / filter for a report in report builder 3.0.
I have the view of customers orders
ID, OrderID, Department, Date, delivered, Cancelled
columns delivered and Cancelled, are represented by 1, or 0
I want to have a parameter that the user of the report can select, the number of times an ID cancels a orders.
this can be 1, 2,3 or even 4 times.
thus when a user selects e.g 4, it filters the table to IDs that have cancelled orders 4 times
I thought of creating a count, and group on the ID in the SQL view.
however I need the date of each of the orders in the view. to see what dates the cancellations was occurring. thus just getting 1 per row.
So I can't create a parameters based on distinct number of cancelations, I would just return 1
any ideas please
Thank you bjones, that outer apply worked (see comment)
Thank you x
thanks team
Generate a query to count and display the number of full time and number of part time employees, the total pay of all fulltime employees and the total pay of all the part time employees.
Workings:
So I have the fields Status and Total Pay. I added the field Status and the field Status again which is a Count but it is hidden. I then added a new field called "Number of Each Status Type". I then referenced it to Status and gruped it by count.
This gave the desired first two rows of the image.
I am not sure on how to get the third though. How would I get the Total Pay by Status. Any help will be appreicated.
It has look like this
What I have for Query
I'm trying to calculate the average for only particular records
For example, we have a field called FurthestSlide. This field will contain numbers. We have another field called SlideCount. This is also a number field.
I only want it to calculate the average for the records where the FurthestSlide does not equal the SlideCount number.
What I am trying to find is the average FurthestSlide number for those people who did not view the entire message.
I do not want those who finished the message to be calculated in the data.
Sample Data:
SlideCount=40
FurthestSlide=(30,20,40,40,40)
The answer should come out to 25. (30+20)/2
You can exclude certain rows from an aggregate.
With your data:
And a simple report:
I have calculated the average for non-matching rows with the expression:
=Avg(IIf(Fields!FurthestSlide.Value <> Fields!SlideCount.Value
, Fields!FurthestSlide.Value
, Nothing))
Here we set matched rows FurthestSlide value as Nothing, which means they are excluded from any average calculation.
This gives the required result for your data:
I'm using MS Access 2010
My query has the fields, Date, Market Price, Actual Price
I need to separate out within the query by date Actual Price/Market Price in order to achieve a percentage which I can then average (for that day only, one day at a time)
Each day will have anywhere from 10-50 items.
You'll want to use a standard query, but a totals to the query. On the Home tab, in the Records group, click Totals.
Once you have that field displayed you can put a Sum (in the Totals field) for Market Price and Actual Price; and then make sure the Date field is set to GroupBy.
Then you should be getting totals for the Price fields grouped by Date.
btw., I'd label that date field something else other than just Date (e.g., DateSold, PurchaseDate, etc.) just to avoid confusion and possible conflicts with the Date type.
I basically want to create a payment schedule in a separate table based on 4 values that a user would select. The payment schedule is very basic and the table only needs 2 columns, 1) Date of payment, 2) payment amount.
The 4 criteria values that are used to fill out this simple table would be: 1) the total amount of money, 2) number of payments, 3) the frequency of the payments (monthly, quarterly, semi-annually, annually), 4) the date of the first payment.
The way that I envision this is having a Form where these 4 values will be selected. On that form there can be a button to execute the command to fill in a datasheet with the appropriate values.
The first entry would obviously be on the date of the first payment, and the amount for that entry would be the total amount divided by the number of payments. For the second record dollar amount would be the same and the date would be the first payment date + the frequency. So if the first payment date is 1/1/2000 and the frequency annually, then the second entry date would be 1/1/2001. Etc.. until the last payment is made.
While it is a pretty simple payment schedule, I'm not sure how to best approach this in Access and if it's even possible. Would appreciate some input and direction. Thank you!
You will need
-- A numbers table with integers from 0 to the highest number of payments possible, indexed on the number.
-- A combobox called Frequency on forms payments with the following properties:
Row source: q;quarter;m;month;ww;week
Row source type : value list
Bound column : 1
Column count : 2
Column widths : 0, 1
-- A query
INSERT INTO Payments ( UserID, PaymentDate, Payment )
SELECT [Forms]![Payments]![UserID],
DateAdd([Forms]![Payments]![Frequency],
[Number],
[Forms]![Payments]![Startdate]) AS Expr2,
[Forms]![Payments]![LoanAmount]/
[Forms]![Payments]![NumberOfPayments] AS Expr3
FROM Numbers
WHERE (((Numbers.Number)<[Forms]![Payments]![NumberOfPayments]));
-- A button to run the query.