Conditional formatting in a Group Type Footer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kcdoell
    New Member
    • Dec 2007
    • 230

    Conditional formatting in a Group Type Footer

    Hello:

    I have a report that is grouped by Product Type. In the detail section, I am currenly focusing on the following fields:

    [GWP]
    [Binding_Percent age]

    In the Product Type footer I placed two unbound text boxes. The first on is called "SumofGWP" with its control source set to[code=vb]=Sum([GWP]) [/code]. That works no problem.

    The second box is called "Sum_ByPer_GWP" . This needs to sum only the [GWP] whose [Binding_Percent age] is >= 75. So I thought I would set the control source to: [code=vb]=Sum(IIf([GWP]="[Binding_Percent age] >= 75",0)) [/code] , but I get an error when I run the report indicating that the

    [code=text]
    This expression is typed incorrectly, or it is too complex to be evaluated. Try simplifying the expression..... ..[/code]

    I have the "RunningSum " properties of my [Sum_ByPer_GWP] set to "No"

    Any ideas what I am missing?

    Thanks,

    Keith.
  • kcdoell
    New Member
    • Dec 2007
    • 230

    #2
    I even tried this as well:

    [code=vb]=IIf([Binding_Percent age]>=75,Sum([GWP]),0) [/code]

    No errors, calculates but not filtering by [Binding_Percent age] parameter.

    Thanks,

    Keith.

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      Originally posted by kcdoell
      I even tried this as well:

      [code=vb]=IIf([Binding_Percent age]>=75,Sum([GWP]),0) [/code]

      No errors, calculates but not filtering by [Binding_Percent age] parameter.

      Thanks,

      Keith.
      Your first statement:
      [code=vb]=Sum(IIf([GWP]="[Binding_Percent age] >= 75",0)) [/code]
      is missing the False parameter and the second has the sum in the wrong place...

      Guess you need:
      [code=vb]
      =Sum(IIf([GWP]="[Binding_Percent age] >= 75",[GWP],0)) [/code]

      Nic;o)

      Comment

      • kcdoell
        New Member
        • Dec 2007
        • 230

        #4
        Hello:

        Thanks for the reply. I place the following, as suggested, in the control source.
        [code=vb]=Sum(IIf([GWP]="[Binding_Percent age] >= 75",[GWP],0))[/code]
        but when I ran it, the following message came back to haunt:
        [code=text]This expression is typed incorrectly, or it is too complex to be evaluated. Try simplifying the expression..... ..[/code]

        Do you see anything missing?

        Thanks,

        Keith.

        Comment

        • kcdoell
          New Member
          • Dec 2007
          • 230

          #5
          Okay, I have been playing with this. When I put in the "" around the controls:
          [code=vb]=Sum(IIf("[GWP]"="[Binding_Percent age] >= 75","[GWP]",0))[/code] the error went away and the report ran. But the result that was displayed was zero (0). I can see that I had values of >=75 so it should have calculated something. Any ideas why it did not work??

          Thanks,

          Keith.

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Originally posted by kcdoell
            Okay, I have been playing with this. When I put in the "" around the controls:
            [code=vb]=Sum(IIf("[GWP]"="[Binding_Percent age] >= 75","[GWP]",0))[/code] the error went away and the report ran. But the result that was displayed was zero (0). I can see that I had values of >=75 so it should have calculated something. Any ideas why it did not work??

            Thanks,

            Keith.
            Hmm, I assumed that the variable GWP held a textstring, guess you need:

            =Sum(IIf([Binding_Percent age] >= 75,[GWP],0))

            There might also be a "problem" with the percentage, as you might see 75, but internally 0.75 is recorded....

            Nic;o)

            Comment

            • kcdoell
              New Member
              • Dec 2007
              • 230

              #7
              Originally posted by nico5038
              Hmm, I assumed that the variable GWP held a textstring, guess you need:

              =Sum(IIf([Binding_Percent age] >= 75,[GWP],0))

              There might also be a "problem" with the percentage, as you might see 75, but internally 0.75 is recorded....

              Nic;o)

              That was it! Thanks a million. I new I was close to getting there but I am still learning. In fact my [Binding_Percent age] is a drop down menu with a list of 0,50,75,or 100 so the 0.75 scenario will not be an issue but of course it could have been.

              Thanks so much!!

              Keith ;-)

              Comment

              Working...