SSR Sorting Expression using Report!Items - ssrs-2008

I have a report using Matrix table group by Business with Sub-total and grand total. I have a calculated field called "% of Received" column that uses Report!Items in the detail row, and I want to sort it from highest to lowest value =ReportItems!MTDPACount.Value/ReportItems!MTDLOBTotal.Value, but it is giving me an error that Report Items cannot be used in expression. Please advise.
Thanks

Have you checked whether some of the ReportItems!MTDLOBTotal.Value are NULL or 0? If so, treat ReportItems!MTDLOBTotal.Value first, add ISNULL and WHERE column != 0 to your query or Stored Procedure to filter out those invalid denominator. Or you could directly add condition in the expression to treat 0 or NULL for your ReportItems!MTDLOBTotal.Value

Related

Tableau: Previous_Value For Strings

I am new to tableau.
Just recently, I have encountered a problem regarding getting a string value from the previous row
I tried using Previous_Value function but it does not work. :<
Image of the error
Instead of previous value which could be tricky when dealing with partitions, you may use the LookUp function
Returns the value of the expression in a target row, specified as a relative offset from the current row. Use FIRST() +n and LAST() -n as part of your offset definition for a target relative to the first/last rows in the partition. If offset is omitted, the row to compare to can be set on the field menu. This function returns NULL if the target row cannot be determined.
You can create a calculated field Order ID Lookup - 1:
LOOKUP(max([Order ID]),-1)
Remember that Lookup requires an aggregate value as first argoment (in my example you can use either min, max, etc...) followed by the offset you need (in this example it's 1 for previous record).
Once you have your previous value, you can create another calculated field Check:
if max([Order ID]) = [Order ID Lookup - 1]
then '='
else '!='
end
Since Lookup needs an aggregate function, you should "wrap" your Order ID with an aggregation function as well in order to compare those 2 values.
Here's the final result:

How to implement a conditional fomula in Crystal Report

I have a table named tblRecovery with 4 column. ID, LStatus, Amount and RecoveredBy I created a formula to sum Amount Column where LStatus Column value is "WCL". I use following code.
It sum all value of Amount column without condition. I want to sum amount column if Lstatus Column value is "WCL". How can I do that?
if {tblRecovery.LStatus}='WCL' then sum({tblRecovery.Amount})
Crystal Reports formulas work on a per-record basis.
Your current formula shows the sum of tblRecovery.Amount on every single row where LStatus='WCL'.
To get the desired result, create a formula-field with following formula and the create a sum of it:
if {tblRecovery.LStatus}='WCL' then
{tblRecovery.Amount}
else
0

Crystal- Reports: Exclude a field value from running total

In crystal reports is how can one exclude a field value from running total. This field is not suppressed however we donot want to add its value to the sum total.
I would suggest you to create one more column for the calculation purpose and then place after the last column and write below formula:
if column="NonDelivery"
then value
else 0
Now take the sum of this column and then place the sum below your mail value column and supress the newly created column.

Using running totals in formulas - Crystal reports

I have created a set of running totals looking for specific fields in a database.
If these fields are located, a subsequent sum is performed to calculate the total for that field. e.g. Field to Summarise - DB.Field.Value-Sum. Evaluate - Use a Formula-Field Name ='1'
This sums the totals for this field. The issue is that I have many running totals doing this, and what I want to do is add these together to provide a total for all of these. Currently I have a formula that uses each field with a '+' between each. This appeared to work fine, but when tested against a record where some of these fields are blank, the subsequent formula displays nothing.
Any advise on what I should do here/ am doing wrong?
Thanks
It sounds like a null record (empty value) is breaking your running total. You have a few options
Use a formula to check for, and replace a null value with another value (Zero, for example) and then use that formula in your running total calculation
if isnull({Command.Decimal}) then 0 else {Command.Decimal}
Use a SQL expression to replace null with another value Isnull(Tablename.Columnname,0) - use this in your running total
On the running total, under "evaluate" select Use a formula and use this formula not(isnull({tablename.columnname})) -- If the record IS null, the running total does not evaluate it. It will be ignored by the running total.

The value expression for the texttrun 'Textbox86.Paragraphs[0].TextRuns[0]' contains an error: [BC30451] Name 'IFF' is not declared

I am newbie and designing SSRS. Used Row Groups(DistrictName,StoreName,Employee_Name) and Column Groups (MetricsOrder,MetricsName,Year,Month).
Finally it prints 2 total value.
First it prints District Total and another one is the overall total. I need to Check some condition and the value may differ upon the condition.
Here is my expression. Checking weather is it current month. If so, multiply SUM values with RR(Parameter). If not, just print the SUM value
IFF((MONTH(TODAY())=Fields!Month.Value),Sum(Fields!MetricValue.Value)*Parameters!RR.Value,Sum(Fields!MetricValue.Value)
When i run the Report im getting the below error.
An error occured during local report processing. The definition of the
report '/Report11TRIAL2 is invalid'. The value expression for the
texttrun 'Textbox86.Paragraphs[0].TextRuns[0]' contains an error:
[BC30451] Name 'IFF' is not declared.
Could any one help me to fix this error.
I believe the expression should be:
IIF((MONTH(TODAY())=Fields!Month.Value),Sum(Fields!MetricValue.Value)*Parameters!RR.Value,Sum(Fields!MetricValue.Value)
IIF, not IFF.