Showing posts with label sum. Show all posts
Showing posts with label sum. Show all posts

Thursday, March 8, 2012

"Jump to Report" hyperlink only if there is data?

I basically want to disable the "Jump to Report" ability in my report if the column has a sum of 0. If the sum is greater than 0 I want it to allow hyperlinking.

Here is what I have in the textbox "Jump to Report" section (where you select the sub report from the dropdown)

=Iif(Fields!Not_Patched.Value > 0, "subRPT_Enterprise Vulnerability Report By PLUS", False)

This works, however I get the following Warning when running the report...

[rsInvalidExpressionDataType] The DrillthroughReportName expression used in chart ‘chart1.DataPoint.ActionInfo.Action’ returned a data type that is not valid.
Preview complete -- 0 errors, 1 warnings

Can anyone assist in why I'm getting this warning? I have tried to search this forum and google but no answers...

Instead of False use Nothing:

=Iif(Fields!Not_Patched.Value > 0, "subRPT_Enterprise Vulnerability Report By PLUS", Nothing)

Thanks, Donovan.

Saturday, February 11, 2012

#Error when trying to SUM field in dataset

I created a calculation field (Named Posted_InHouse in my dataset as such:

=IIf(Fields!Type.Value = "In-House", Fields!PostedAmount.Value, 0)

My purpose was to then be able to sum PostedAmount in my table Group field only if it comes from an In-House record.

I put this in

=SUM(Fields!Posted_InHouse.Value)

Now I get #Error in my group field when in preview

Have you tried: Cint(IIf(Fields!Type.Value = "In-House", Fields!PostedAmount.Value, 0))

I have found that sometimes you need to specifically specify the output of an iif statement.

#Error when printing report

I have a field on a Group Footer which is a Sum field based of an IIF statement.

Here it is.

=Sum(IIF(Fields!EXPR1.Value=2 and Fields!Type.Value=1,Fields!Quantity.Value,0))

If I do not use the AND, by by only checking on one field it works fine and it returns a result, however if I use the AND Operator I get the #Error when previewing the report.

Does anyone have any idea why this is happening. Any suggestion would help/


THanks

Can you try to get more information about the #Error? The output window should have something listed about your error.

Jarret

|||

I figured this one out.

I used the cddl to convert the values to double values.


Thanks

#ERROR on SUM if Field value is a string

Hi,

I have some columns that can be either a Number or Text.

and I have to sum all the value if that column is a Number, therefore in my Table footer i have:

=IIF(IsNumeric(Fields!Col1.Value),Sum(Fields!Col1.Value),"")

However this will give me #ERROR if the columns is Text. It works for Number.

Any help is appreciated, thanks

Jon

Try =Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,""))

|||

Thanks for your reply.

unforunately i tried you suggestion but it didn't help, it still gives me #error

any other idea i can try?

thanks

|||

How about:

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,Nothing))

or

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,0))

|||

Thanks!

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,Nothing))

works well for most of them, but Not on columns which are TRUE/FALSE?

|||

Do you mean columns that are declared as a of Bit data type? If so, they are probably passing the IsNumeric test.

|||

Try:

=IIF(IsNumeric(Fields!Col1.Value),Sum(val(Fields!Col1.Value)),0)

Val() function returns the number part of the string.

Somiya.

#ERROR on SUM if Field value is a string

Hi,

I have some columns that can be either a Number or Text.

and I have to sum all the value if that column is a Number, therefore in my Table footer i have:

=IIF(IsNumeric(Fields!Col1.Value),Sum(Fields!Col1.Value),"")

However this will give me #ERROR if the columns is Text. It works for Number.

Any help is appreciated, thanks

Jon

Try =Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,""))

|||

Thanks for your reply.

unforunately i tried you suggestion but it didn't help, it still gives me #error

any other idea i can try?

thanks

|||

How about:

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,Nothing))

or

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,0))

|||

Thanks!

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,Nothing))

works well for most of them, but Not on columns which are TRUE/FALSE?

|||

Do you mean columns that are declared as a of Bit data type? If so, they are probably passing the IsNumeric test.

|||

Try:

=IIF(IsNumeric(Fields!Col1.Value),Sum(val(Fields!Col1.Value)),0)

Val() function returns the number part of the string.

Somiya.

#ERROR on SUM if Field value is a string

Hi,

I have some columns that can be either a Number or Text.

and I have to sum all the value if that column is a Number, therefore in my Table footer i have:

=IIF(IsNumeric(Fields!Col1.Value),Sum(Fields!Col1.Value),"")

However this will give me #ERROR if the columns is Text. It works for Number.

Any help is appreciated, thanks

Jon

Try =Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,""))

|||

Thanks for your reply.

unforunately i tried you suggestion but it didn't help, it still gives me #error

any other idea i can try?

thanks

|||

How about:

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,Nothing))

or

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,0))

|||

Thanks!

=Sum(IIF(IsNumeric(Fields!Col1.Value),Fields!Col1.Value,Nothing))

works well for most of them, but Not on columns which are TRUE/FALSE?

|||

Do you mean columns that are declared as a of Bit data type? If so, they are probably passing the IsNumeric test.

|||

Try:

=IIF(IsNumeric(Fields!Col1.Value),Sum(val(Fields!Col1.Value)),0)

Val() function returns the number part of the string.

Somiya.