Expression for getting total value of a field etc - reporting-services

I need help for the following
1) Could you give me expression for getting total of a field in SSRS
2) My date saved in database is mm/dd/yy, when shown in report, I want to show it like May 21, 2011, How?
Thanks a lot.
Furqan

1) =Sum(Fields!YourField.Value)
2) =Format(Parameters!DateField.Value,"MMM dd,yyyy")
This answer your questions?

Related

Crystal to SSRS conversion

DateValue(ToNumber(Mid({Command.Next_coupon_underlying_test}, 1, 4)),
ToNumber(Mid({Command.Next_coupon_underlying_test}, 6, 2)),
ToNumber(Mid({Command.Next_coupon_underlying_test}, 9, 2)))
I need to have SSRS Expression
As you have no supplied any sample data/values I can only assume that you have a date column that contains a date as a string in the format "2022-11-30" and that you want to convert this into a real date.
If this is true then you can do one of two things.
=CDate(Fields!myFieldName.Value)
Or if you really want to replicate the functionality of your existing expression then something like this...
=DATESERIAL(
MID(Fields!myFieldName.Value,1,4),
MID(Fields!myFieldName.Value,6,2),
MID(Fields!myFieldName.Value,9,2)
)
If this is not helpful, please edit your question and provide more information.

SSRS standalone formulas

I have been working on this for days without being able to solve yet. It's probably simple if you know what you're doing. I'm simply trying to make a standalone formula that is not in a tablix or anything, it's just in a textbox.
Here is an example of my Dataset called Dataset1:
What I am trying to get is a sum of the Actual Cost when the Category is Labor from Dataset1. My current expression is:
=Sum(iif(Fields!Category.Value="Labor", Fields!ActualCost.Value, 0), "Dataset1")
I refer to Dataset1 as my scope because otherwise, I get an error about using an aggregate expression without a scope.
The report runs but shows #Error in the textbox that has my expression in it. When I replace Fields!ActualCost.Value with a 1, I get the answer, 5, which is the correct number of rows with Labor as the Category. But it won't let me sum the numbers in the ActualCost column where Category is Labor.
Any ideas as to what I'm doing wrong? I feel like it's something to do with aggregating, but I'm not sure. Thanks!
It may have to do with the datatype of fields!ActualCost.Value. If that field is a decimal (regardless of how you have it formatted), try using cdec(0) instead of just 0 in your expression.

Multiple iif and condition in SSRS expression

I get an error from the below expression in SSRS report. If status is active and month_nbr and year_nbr is greater than last day of status_DT, it will show count_value which is int type. Can you help me fix it? Thanks!
=IIf((fields!status.value="Active") and
(cdate("01"+Fields!month_nbr.Value+Fields!year_nbr.Value)>
DateAdd("d",-1,(DateAdd("m", 1, DateSerial(Year(fields!Status_DT.value),
Month(fields!Status_DT.value), 1))))),Fields!Notes_Count.Value,"9999")
Try replacing:
cdate("01"+Fields!month_nbr.Value+Fields!year_nbr.Value)
by:
CDATE(CStr(Fields!year_nbr.Value)+"-"+CStr(Fields!month_nbr.Value)+"-01")
Let me know if it works.

Calculated field in SSRS

I have tried to create a calculated field that will show the number of customer transactions processed within 15 minutes.
I have added the expression:
=count(fields!wait.Value<15)
However, when I run the query I'm getting the error message : 'expression used for the calculated field includes an aggregate RowNumber...'
Can you advise please on how to create a calculated field so I can capture the value I want?
I have tried = SUM(IIF(Fields!wait.Value < 15 , 1, 0)) to no avail.
With many thanks.
Calculated fields added to datasets can't have aggregate functions. The calculated field is essentially adding an extra column to your dataset. It sounds like you may want a variable? Used elsewhere in the report, your second expression would work, or the similar
=Count(IIf(Fields!wait.Value<15, 1, Nothing))
would work too.

SSRS - creating chart - overlapping year - end of year/start of next

I have to report on some data covering November, December of 2013 and Jan, Feb of 2014. I know how to chart over a calendar year but I'm struggling with this...any one know how i can chart this in nov,dec,jan,feb order???
cheers
You have to have some field available in your dataset or a calculation based upon a field/fields that orders them correctly. If you have something like yyyy-mm (ex: 2013-11) you can set the sort order of the category group within your chart. Leave the actual value as you want it to be seen, just change the sort order.
Here's a good blog post that (I think) explains exactly what you are trying to do: http://www.allaboutmssql.com/2013/06/ssrs-in-charts-how-to-sort-labels-on-x.html
Sort the data first by =Year(Fields!YourDateField.Value) and then by =Month(Fields!YourDateField.Value)
Thanks for the input... i found this Custom ordering of series field for stacked chart in SSRS08 TFS
so i manually changed the value value with a switch and then ordered A-Z
All good now
cheers