TABLE SUBTOTAL EXPRESSION

  • Hi

    I need some help constructing/modify the below expression:

    =IIf(Sum(Fields!totalmoney.Value)>105, (Sum(Fields!totalmoney.Value)-105)*0.128, 0) as a sub total in a table.

    this currently gives the below result.

    total money NI

    bob20012.16

    ted1040

    subtotal30425.47

    which is obviously incorrect.

    Can anybody help me with an expression that will give the correct result ie 12.16.

    thanks

  • simon.lewis (11/25/2008)


    Hi

    I need some help constructing/modify the below expression:

    =IIf(Sum(Fields!totalmoney.Value)>105, (Sum(Fields!totalmoney.Value)-105)*0.128, 0) as a sub total in a table.

    this currently gives the below result.

    total money NI

    bob20012.16

    ted1040

    subtotal30425.47

    which is obviously incorrect.

    Can anybody help me with an expression that will give the correct result ie 12.16.

    thanks

    Should use:

    =IIf((Fields!totalmoney.Value)>105, ((Fields!totalmoney.Value)-105)*0.128, 0.0) in the detail rows (notice the 0.0 - that is changed from just 0 to maintain consistent return data types; i.e. decimal instead of int)

    then use:

    =SUM(IIf((Fields!totalmoney.Value)>105, ((Fields!totalmoney.Value)-105)*0.128, 0.0)) in the subtotal

    I think that would work but I could be wrong... this is assuming a grouping in the table with a group footer for the subtotal.

  • First, is this SSRS? Reporting Services? Please post in those forums.

    Second, you show 12.16 as a result and then say you want 12.16. Am I missing something?

  • thanks for your help. Unfortunately, I need to "sum(field!totalmoney.value)" & ssrs will not allow me to sum within a sum expression.

  • I apologise, yes it is an SSRS problem. I will post there also. The problem I have is that the expression I am using is giving me, a subtotal result of the expression being applied against the total money subtotal ie (304-105)*0.128=25.47, not 12.16.

    Sorry again, I am new to forums

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply