Evaluating Multiple values and then Displaying Text - InfoPath Dev
in

InfoPath Dev

Evaluating Multiple values and then Displaying Text

Last post 08-22-2011 08:33 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-18-2011 03:41 PM

    • mrmapi
    • Not Ranked
    • Joined on 08-11-2011
    • Posts 7

    Evaluating Multiple values and then Displaying Text

    I have a calculation scenario where I would like to display text based on the evaluation of certain fields.  There are five fields which are basically subtotal fields that contain a number

    Field1 - Unsatisfactory

    Field2 - Needs Improvement

    Field3 - Meets

    Field4 - Exceeds

    Field5 - Far Exceeds

    In a 6th text box, i need to be able to show a result based on the conditions below. The line starting with asterisks is what I am most interested about since I am able to evaluate based on a single value.  All of the conditions below I need to put in the same text box if possible.

    1.  If Field1 has a value of 2 or higher, display "Unsatisfactory"

           Concat(substring("Unsatisfactory", 1,(Field1 > 1) * String-Length("Unsatisfactory"))

    2.  If Field2 has a value of 3 or higher, display "Needs Improvement"

    3.  If Field2 has a value of 2 and Field1 has a value of 1, display "Needs Improvement"

    ***4.  If Field4 has a value of 7 and Field3 has a value of 5, display "Exceeds" ( I thought I had it working, but it displays duplicate values if more than one condition is met)

     concat(substring("Unsatisfactory", 1, (Field1 > 1) * string-length("Unsatisfactory")), substring("Needs Improvement", 1, ((Field1 = 1) + (Field2 = 2)) * string-length("Needs Improvement")), substring("Needs Improvement", 1, (Field2 > 2) * string-length("Needs Improvement")), substring("Exceeds", 1, ((Field4 > 6) + (Field5 > 4)) * string-length("Exceeds")))

    5.  If Field5 has a value of 8 and Field4 has a value of 4, display "Far Exceeds"

    6.  Display "Meets" in any other situation

     Any help would be much appreciated!

    Thanks,

    Jason

  • 08-22-2011 08:33 AM In reply to

    Re: Evaluating Multiple values and then Displaying Text

    Why not simplify this all by creating these 6 conditions as rules on those 5 fields, using the option Stop executing rules if this condition is met?

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