Combining Sum and Eval in Infopath 2010 - InfoPath Dev
in

InfoPath Dev

Combining Sum and Eval in Infopath 2010

Last post 10-02-2011 09:10 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-01-2011 09:25 PM

    Combining Sum and Eval in Infopath 2010

    Ok, after 5 hours trying to solve this, I give up!!

     This is what I am trying to do:

    I am creating an Infopath 2010 form to request printouts in a SharePoint Library. Since i have color and blak/white pages, I need to sum the total of color pages separately from the total of black and white pages (like a sumproduct in Excel).

    My formula would calculate:

    Total Color = Sum ( if (Color = "Color" , No_Pages * Times)

    Total B/W    = Sum ( if (Color =  "B/W" , No_Pages * Times)

     This is how it looks in XPad:

    sum(xdMath:Eval(../my:group8[../my:group8/my:Color = "B/W"], "../my:group8/my:No_Pages * ../my:group8/my:Times"))

    Obviously I am making a mistake since the form doesn't calculate the values as I expected. Any suggestions?

    Sum Black

    EB
  • 10-02-2011 05:23 AM In reply to

    Re: Combining Sum and Eval in Infopath 2010

    How's this:

    sum(xdMath:Eval(../my:group8[my:Color = "B/W"], "my:No_Pages * my:Times"))
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-02-2011 07:46 AM In reply to

    Re: Combining Sum and Eval in Infopath 2010

    Right on the spot!!

     Thanks!

     Where can I learn how to write these formulas?

    EB
  • 10-02-2011 09:10 AM In reply to

    Re: Combining Sum and Eval in Infopath 2010

    Hopefully someone else can recommend a book or something, but the best I can recommend is to tinker and experiment a lot, and lurk these forums.  As with anything else, there's no substitute for experience. :-)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.