Formula - InfoPath Dev
in

InfoPath Dev

Formula

Last post 01-17-2013 01:17 AM by sarnst. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-16-2013 04:11 AM

    • sarnst
    • Not Ranked
    • Joined on 01-16-2013
    • Posts 3

    Formula

    Am looking for a formula

    question has four options for an answer in the dropdown.
    Question:

    Answer 1
    Answer 2
    Answer 3
    Answer 4

    the overal weight of this answer is 25%
    1 = 0
    2 = 1
    3 = 2
    4 = 3
    Like:

    Question Answer Rating  Weighing
    1 3 25 0.250
    2 3 5 0.050
    3 3 5 0.050
    4 3 5 0.050
    5 3 5 0.050
    6 3 25 0.250
    7 3 5 0.050
    8 3 5 0.050
    9 3 2.5 0.025
    10 3 2.5 0.025
    11 3 2.5 0.025
    12 3 2.5 0.025
    13 3 5 0.050
    14 3 5 0.050
    1.000

    the result should be:

    Low < 0.5
    Medium >= 0.5
    < 0.75
    High >= 0.75

    Depending on the result I will show an image. I am looking for the formula which calculates the answer divided by 3 weighing 25% or 5% or 2.5%
    To create a sum from the fields I understand
    To display the images accordingly I understand

  • 01-16-2013 05:56 AM In reply to

    I think the formula you need to calculate the total is something like this:

     sum(eval(Question, "my:Rating * my:Weighing"))

    could you give that a try?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-16-2013 06:57 AM In reply to

    • sarnst
    • Not Ranked
    • Joined on 01-16-2013
    • Posts 3

    Hi Jimmi thanks for the fast respose

    So you have this for me a bit clearer as when I enter it now I get an error. I suspect it's because I am not filling in the correct things

    I have one of the dropdowns set to value = 3

    so then I go to apply 4 rules basically one for each when they pick that one.

    So i would go and set the rule

    when field6 contains "text" rule type "action"

    the action = set a fields value

    field6

    and in the value of that i fill in the underneath?

    like:

    sum(eval(field6, "my:3 * my:25%"))

    sum(eval(Question, "my:Rating * my:Weighing"))

  • 01-16-2013 10:11 AM In reply to

    Hello,

        What I mean is that you would create a non-repeating field outside of the repeating group, and use a formula like that as its default value formula. You would replace Question with the name of the repeating group (you can use the field/group selection dialog for this one), and you would replace "Rating" and "Weighing" with the names of the fields you are using for "Rating" and "Weighing" in your repeating group.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-17-2013 01:17 AM In reply to

    • sarnst
    • Not Ranked
    • Joined on 01-16-2013
    • Posts 3

    Hi Jimmy, confusion is my middle name now :-)

    I have to create a not repeating field outside of the repeating group?
    I haven't created a repeating group just fields by itself.

    This is one of the fields

    (dropdown list box properties)If the value is 0 , 1 , 2 or 3 it needs to be divided by 3 and the weighing of the value is different from25%5%2.5%The outcome from all fields should be

    Low

    <  0.5
    Medium >= 0.5
    <  0.75
    High >= 0.75
     (all in all 15 fields, each with 4 dropdwons)So I go and create a rule. If field contains and then I fill in either 0 – 1 – 2 or 3Do I set the formula here?

    Rule details and then fill it in the value box ? 

    So I set field dropwon to be the valuesum(eval(Question, "my:Rating * my:Weighing")) ?should I submit all of this in a section field because they do depend and relay on each other and the final outcome?

     

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.