Group sum is wrong

  • Hello,

    i have one question:
    My Report has three Groups. For the Detail Group i use following Expression:

    =IIF(Fields!version.Value = Max(Fields!version.Value,"date"),Fields!amount.Value,cdbl(0))

    In the last Group I get the wrong result. I use this Expression:

    =SUM(IFF(Fields!version.Value = MAX(Fields!version.Value),Fields!amount.Value,CDBL(0)))

    I should get 197 but there is only 95...
    Someone knows why he calculated this Field wrong?
    Sorry for my bad english.

  • i756311 - Monday, July 3, 2017 2:06 AM

    Hello,

    i have one question:
    My Report has three Groups. For the Detail Group i use following Expression:

    =IIF(Fields!version.Value = Max(Fields!version.Value,"date"),Fields!amount.Value,cdbl(0))

    In the last Group I get the wrong result. I use this Expression:

    =SUM(IFF(Fields!version.Value = MAX(Fields!version.Value),Fields!amount.Value,CDBL(0)))

    I should get 197 but there is only 95...
    Someone knows why he calculated this Field wrong?
    Sorry for my bad english.

    It's only adding the values where Ver is 57 which is the max value of the column. I'm not sure if you need to remove the IIF function or just correct it with the correct fields.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares - Monday, July 3, 2017 7:15 AM

    i756311 - Monday, July 3, 2017 2:06 AM

    Hello,

    i have one question:
    My Report has three Groups. For the Detail Group i use following Expression:

    =IIF(Fields!version.Value = Max(Fields!version.Value,"date"),Fields!amount.Value,cdbl(0))

    In the last Group I get the wrong result. I use this Expression:

    =SUM(IFF(Fields!version.Value = MAX(Fields!version.Value),Fields!amount.Value,CDBL(0)))

    I should get 197 but there is only 95...
    Someone knows why he calculated this Field wrong?
    Sorry for my bad english.

    It's only adding the values where Ver is 57 which is the max value of the column. I'm not sure if you need to remove the IIF function or just correct it with the correct fields.

    Hmm, thank you very much. Now I know why they Display 95! But I am not sure how I get the correct expressions that my result is 197... Because if I only make =SUM(Fields!amount.Value) they Show me the sum of all rows (hide and Show) and not only the shown rows...

  • Without more information, I can't be of much help.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • i756311 - Monday, July 3, 2017 7:44 AM

    Luis Cazares - Monday, July 3, 2017 7:15 AM

    i756311 - Monday, July 3, 2017 2:06 AM

    Hello,

    i have one question:
    My Report has three Groups. For the Detail Group i use following Expression:

    =IIF(Fields!version.Value = Max(Fields!version.Value,"date"),Fields!amount.Value,cdbl(0))

    In the last Group I get the wrong result. I use this Expression:

    =SUM(IFF(Fields!version.Value = MAX(Fields!version.Value),Fields!amount.Value,CDBL(0)))

    I should get 197 but there is only 95...
    Someone knows why he calculated this Field wrong?
    Sorry for my bad english.

    It's only adding the values where Ver is 57 which is the max value of the column. I'm not sure if you need to remove the IIF function or just correct it with the correct fields.

    Hmm, thank you very much. Now I know why they Display 95! But I am not sure how I get the correct expressions that my result is 197... Because if I only make =SUM(Fields!amount.Value) they Show me the sum of all rows (hide and Show) and not only the shown rows...

    Whatever expression you use to allow a row to be shown will have to appear instead of checking for the MAX value.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

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

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