Sorting on Group in SSRS Report - reporting-services

I have report that based on the Createdon date group and its amount on that.so I have created group on createdon in SSRS Report and also put sorting based on createdon date.The data is like this
Date Total Amount
6-22-2013 500
5-23-2013 500
5-24-2013 1000
5-28-2013 200
6-21-2013 300
6-23-2013 400
I shown you some of the data.same way that are lots of data and every data shown as expected.but expect the one data as you can see the first record regarding 6-22-2013.It should be come second last based on group as i sort group based on Createdon date.I feel that this bug is from Microsoft.However I am not sure but how can only one record created this problem?Any help from anybody would be appreciated.

Can you check if the date field is actually date. I mean if it is text then it will be sorted arbitrarly .

Try sorting by below expressions
=day(Fields!createdon.Value)-- 1st sort expression
=month(Fields!createdon.Value)--2nd sort expression
=Year(Fields!createdon.Value)-- 3rd sort expression

Related

Sorting a report by Date using Microsoft SQL Report Builder

I am using Microsoft SQL Report Builder and like to sort a report by [FromDate] which is formatted as such 21/02/2019 10:05 am as following:
=FORMAT(Fields!FromDate.Value,"dd/MM/yyyy HH:mm tt")
I think I got an idea how to sort the report by date by going to Tablix Properties > Sorting > Add > Sort by [FromDate] Order: A to Z but it does not sort them ...
I have also set the FromDate column to category: Date
Furthermore, I thought I would also need to change the expression within the Sorting section and tried as such:
=FORMAT(Fields!FromDate.Value,"yyyy.MM.dd")
Still, the report shows 18/02/2019 10:15 AM before 01/02/2019 06:30 AM
Any suggestions?
Thanks
UPDATE
Because I was using group by within the report and I did not use the Sorting within the right section < this was the reason why the sorting of the date did not show in correct order.
Well, sorting of the dates were in order within each group but then the group order was not in tact. So, all I needed to do was to select the 1st column where the group by is set and then set the sorting in there.
In other words the report shows something like this
Group By: Title
Title 1 (contains few entries with the dates)
01/02/2019
05/02/2019
22/02/2019
Title 2 (contains few entries with the dates)
02/02/2019
09/02/2019
01/03/2019
Title 3 (contains few entries with the dates)
25/02/2019
04/04/2019
Booooooom, issue solved :)
UPDATE
Because I was using group by within the report and I did not use the Sorting within the right section < this was the reason why the sorting of the date did not show in correct order.
Well, sorting of the dates were in order within each group but then the group order was not in tact. So, all I needed to do was to select the 1st column where the group by is set and then set the sorting in there.
In other words the report shows something like this
Group By: Title
Title 1 (contains few entries with the dates) 01/02/2019 05/02/2019 22/02/2019
Title 2 (contains few entries with the dates) 02/02/2019 09/02/2019 01/03/2019
Title 3 (contains few entries with the dates) 25/02/2019 04/04/2019
Booooooom, issue solved :)

Is it possible to limit RunningValue to look back for a certain number of rows?

Im trying to average the past 5 rows in my table i created in SSRS grouped by date(Monday of every week). Ive tried runningValue however it looks back at all the past rows for each group. Is there a way to limit the scope to just the past 5 rows or weeks for each Date group.
Thanks
I would accomplish this with grouping. I don't know what your dataset is like but I assume it is a SQL query you can modify. The easiest solution would be to add a week number column to your query. For example:
SELECT datepart(week, YOURDATE) as WeekNumber
More info on datepart:
https://learn.microsoft.com/en-us/sql/t-sql/functions/datepart-transact-sql?view=sql-server-2017
Once you have a week number, use the table creation wizard in Report Builder and add WeekNumber as a row group. This will group your values by week number and give you a total under each week. You can change the total by double clicking and making it AVG() instead of SUM().
Note: If you already have each 5 day period in a group, you should be able to right click that and add total. At which point you can just change the SUM to AVG there.

Formatting a date value in Reporting Services

I am a bit rusty and would be very grateful if you could help. I am using Reporting Services. I am using T-SQL. The date_ordered field mentioned below is data type varchar.
I have a simple report that gives the date_ordered value. Unfortunately, when I ORDER BY date_ordered DESC, it sorts the date by the numerical value of the day, so 31-Oct-14 appears first and 01-Apr-13 last.
I would like the report to show most recent dates first and end with the last date ordered.
I'm sure it's very obvious, but I can't see it.
With many thanks.
you just have to convert your date to a datetime format in tsql. then when you sort it it works as expected.
Select CONVERT (datetime, '24-04-2012', 105 as date) as date,
[date dispatched] from Orders order by 1
see How convert string to date T-SQL? and https://msdn.microsoft.com/en-us/library/ms187928.aspx

SSRS Line Chart X-Axis group by Month

everyone. For the life of me I cannot figure out why the X-Axis is pulling 2 dates in each month when I want it to group by each month. In the Values I have:
Value Field =RunningValue(Fields!new_actualsalesfromsplit.Value, Sum, "Chart1_SeriesGroup")
Category Field: =Fields!closedate.Value
Category Groups =Month(Fields!closedate.Value)
Group On =Month(Fields!closedate.Value)
Series Group by ["salesperson']
The chart should have a line for each sales person, and each month should be a cumulative representation of the sales by that person. Thanks for any help.
Set the category field to "=Month(Fields!closedate.Value)", or something similar that will net the results you need. Right now, even though you're grouping by month, you're still telling SSRS to use the atomic data for your X axis, so that's what it's doing.
It may make your task simpler to just add a Calculated Field to your dataset - open the dataset properties window, go to the fields tab, and click "add". Set that field to your month value, use it for grouping and your X axis.

Sum a Subtotal in MS Access by Date

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.