I have an Access Report. In the footer section of my report I have a list of different totals. I am looking to create these totals based on a time criteron. For example:
Im looking for a count of the included records. I need to determine a count based on either current- 3 months, 4-6 months, 7-12 Months and 13+ Months.
I have created a DateDiff() expression to determine the amount of months. I have created another expression to assign a letter based on what group the result would belong to. For example:
A = Current - 3months
B = 4-6 Months
C = 7-12 Months
D = 13+ Months
How could I use the assigned letter as a count on my report? Could I make a statement in my control source for my display text box to accomplish this?
I'm not sure where to go next...
In the reports On_Open event write some VBA to store the values from your DateDiff into several different String Variables, and then if your footer is a simple text box just update the values e.g.
txtFooter = "3Mnths - " & str3Mnths & " - 4/6Mnths - " & str46Mnths
Related
I'm stuck with a problem in SSRS 2012 that maybe is very simple:
I have a matrix with a group row (employee) and a group column (last 12 months); the values are COUNT(practicesDone) - i.e. the amount of practices worked.
I want the matrix to show an extra column on the right (after all the columns of the months, and clearly outside the column group) with again the number of practices for the current month.
Is it possible to achieve that?
thank you in advance!
You can do this, it's pretty simple.
I have assumed that your dataset contains a column that has a date for each entry and that the data returned only covers 12 months so the same month would not appear for different years. If your data does have multiple years, look at the second expression below.
Right-click your month column and then to "Insert Column --> Outside Group - Right"
Now set the expression for the text box to
=COUNT(IIF(MONTH(Fields!myDateColumn.Value) = MONTH(TODAY()), 1, Nothing))
You could swap COUNT for SUM and it should do the same thing but either will work.
All we are doing here is comparing the all data in scope which, due to the placement of the text box means the scope is the entire rowgroup. Then for all that data, check if the month matches the current month, if it does set it to 1 is not set it to nothing then count/sum all results. Count conveniently ignores 'nothing'.
If you data covers more than 12 months then you can still do this but you'll have to add a bit more to handle years and months like this.
=COUNT(
IIF(
MONTH(Fields!myDateColumn.Value) = MONTH(TODAY())
AND YEAR(Fields!myDateColumn.Value) = YEAR(TODAY()),
1,
Nothing
)
)
I am using SSRS 2016 application to pull data from SharePoint list.
My task is to calculate the average DaysUsed and the average Percentage from a column.
It is a Matrix report which has two columns:
Sum(Fields!Days.Value)
Sum(Fields!Percentage.Value)
The task is to show the average days and average percentage.
I have tried the =Avg(Fields!Days.Value) but this shows wrong result.
UPDATE
Yes, the matrix is grouped by the Month to show each relevant month.
See the screenshot below what I have tested so far.
The DaysUsed is a calculated between 2 fields [FromDate] and [UntilDate] by summarising the total days minus the weekends. see below:
=(DateDiff(DateInterval.day,CDate(format(Fields!FromDate.Value,"MM-dd-yyyy")), CDate(format(Fields!UntilDate.Value,"MM-dd-yyyy")))+1)
- (DateDiff(DateInterval.WeekOfYear,CDate(format(Fields!FromDate.Value,"MM-dd-yyyy")), CDate(format(Fields!UntilDate.Value,"MM-dd-yyyy")))*2)
- IIF(Weekday( CDate(format(Fields!FromDate.Value,"MM-dd-yyyy")),1) = 1,1,0)
- IIF(Weekday( CDate(format(Fields!FromDate.Value,"MM-dd-yyyy")),1) = 7,1,0)
- IIF(Weekday( CDate(format(Fields!UntilDate.Value,"MM-dd-yyyy")),1) = 1,1,0)
- IIF(Weekday( CDate(format(Fields!UntilDate.Value,"MM-dd-yyyy")),1) = 7,1,0)
Furthermore, the [DaysUsed] row then consists of IIF(value is null then show 0 otherwise show the total value of days used).
=IIF(IsNothing(Sum(Fields!Days.Value)), "0", Sum(Fields!Days.Value) )
Sum(Fields!Days.Value)/CountRows()
Shall give you average days. Similarly goes for others as well.
If you has a field called Fields!Days.Value, I guess your data in the screenshot is already grouped by month. This means the expression
=Avg(Fields!Days.Value)
gives you the average over all Days (sum of all days / count of all days).
If you want to use the grouped values (by mounth) you either can use the following expression when you are inside the scope (the monthly socpe; indicated by the brackets on the most left side on your tablix)
=Sum(Fields!Days.Value) / Count(Fields!Days.Value)
If you are not in the scope you have to tell the tablix that is should use your monthly grouping. For this you can use the following:
=Sum(Fields!Days.Value, "YourMonthGroupName") / Count(Fields!Days.Value, "YourMonthGroupName")
Here I am, again with another doubt.
Here is my problem:
I have a report where I show ALL the incomes and expenses of the company for the last two days, which i managed by placing a column group grouping the columns by the date
Originally, the report contained a single matrix with both incomes and expenses fed by a dataset that points to the company cube applying the following filter expression
=IIF(Fields!Fecha.Value=Parameters!FechaHoy.Value or Fields!Fecha.Value = Parameters!DiaAnterior.Value,true,false)
FechaHoy = date sent via report parameter input
FechaAyer = date
parameter minus one day
and the filter value set to
=true
So far so good. Today, the upper management decided to split it into three matrix. One for incomes and other two for expenses (one for each expense category), so i startet with this
initial report layout
I created two new datasets for each one of the expense categories with the same filters, and now i'm here
current report layout
THE THING IS... as you can see, there is a "Total Destino" independent table where i have to add the totals of the second and third matrix in the image I added, but, as I already said I have to show the last two days, so i also have to partially add the total of each day (which are column grouped by date)
I'm pretty sured that there's also a better and more efficient way to manage what I did with the three matrices but the main issue which needs your assistance is how do i add the totals of the second and third matrices.
I already tried with
=Sum(Fields!Saldo.Value, "Informacion_Destino") + Sum(Fields!Saldo.Value, "Info_InvTesoreria")
but it adds the two days and repeat it for the two days. I also tried with ReportItems!TextBox + ReportItems!TextBox but the preview loads sends me an error message.
Thanks in advance for your time and help
Like Harry stated already out you can use for your overall total the following expression for the Tesoreria Subtotal + Destino Subtotal :
=ReportItems!TesoreriaSubtotal.Value + ReportItems!DestinoSubtotal.Value
This would give you the overall total for all days. Now if you just have to show the last two days you can add a tablix filter, like this:
'Expression
=IIF(CDate(Fields!YourDate.Value) < DateAdd("d", -2, Now()), True, False)
'Format
=Boolean
'Value
=False
im working with report that visual studio 2010 have, then i have a chart series with four fields planta, date, and densidad, i have to get the average of all the data that densidad has but only when the date is the same for example
Date Densidad
11/05/2015 2
11/05/2015 3
12/05/2015 4
in this case i have two data from 11/05/2015 the only for that date i must get the average that in this case should be 2,5 , ive been looking for an expression that works but i ve found anything, please?
Add a new row group, then go to the group's properties and group by date. In your tablix, add in AVG(Yourdataset!Yourvalue.Value) next to the date. This should group by date.
Your group expression should look like this:
=FormatDateTime(Fields!dates.Value, DateFormat.ShortDate)
I want to obtain a running sum in query. I'm using the following running sum formula
RunningSum: CCur(Nz(DSum("[Debit]","[Debit]","[CustomerID] =" & [CustomerID] & " AND [vDate] < " & [vDate] & "")))
But it is not working. My purpose is to obtain sum of Debit for all smaller than the current date field, something like this,
http://i.stack.imgur.com/0qoO7.jpg
After going through different threads, I could not find any solution for my problem. I don't know that how I can get the sum of older debit amounts if there is duplicate date.
I think the easiest thing will be to just refer to running sums for all the controls you want to add. For example "31 to 60 Days" is text29 on your report. Create a hidden control called, say, R31to60 and set to Running sum over group, then in the footer, put a text box and set the control source to:
=[R31to60]
It will show the last value for the running sum, that is, the total.
In design view, the highlight shows the running sum control and total. The control can be shrunk down and hidden.
In report view you can see the "total" field shows the last value for running sum.