Translation of Excel IF/OR into INFOPATH - InfoPath Dev
in

InfoPath Dev

Translation of Excel IF/OR into INFOPATH

Last post 10-22-2014 08:38 AM by Sachin Nayar. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-13-2014 09:08 AM

    Translation of Excel IF/OR into INFOPATH

    Hello everyone - I just started using Infopath 2013 a week ago. I am the process of preparing a request form in Infopath which was already prepared in Excel. However, I am having a hard time writing the rule which was easily accomplished using Excel. I am not a computer programmer, am a Chemistry major so please dumb down your response for me to understand.

    My form has 5 fields -

    1. Total score

    2. Alignment

    3. Profit Margin

    4. Production Support

    5. Material Obsolescence

     Fields 2 thru 5 are assigned different scores (0,2,5,10) based on the Project nature. In Excel, I had the formula as follows -

    IF(OR(F43=0,L40=0),0, SUM(F40:43,L40:43))

    In other words, the total score should read the sum of alignment (0-10), profit margin (0-10, production support (0-10) and material obsolescence (0-10).

    However, here's the caveat - if alignment is scored a 0 OR material obsolescence is scored  0, the total project score reads a 0 irrespective of what scores are assigned to profit margin or production support.

    In Infopath, I already carried out the following under RULES for the total project score field -

    New -> Action (not Validation or Formatting)

    Condition -> alignment is equal to 0 or obsolescence is equal to 0

    Run these actions -> Action : Set a field's value / Field : totalprojectscore / Value : 0

    New -> Action

    Condition -> else -> alignment not equal to zero or obsolescence not equal to zero

    Run these actions -> Action : Set a field's value / Field : total project score / Value : sum(alignment | margin | support | obsolescence)

     For the life of me, I don't understand why I don't see any number in the total project score field?

     Any InfoPath experts out there - Can you please help?

    Thanks in advance

    - Sachin

     Can any InfoPath expert out there guide me to get started?

  • 10-16-2014 06:31 PM In reply to

    Re: Translation of Excel IF/OR into INFOPATH

    Hi! So your rules are on the Total Project Score Field? But ... isn't that the field who's value you wish to set?

    A common error I've seen (and one I made a kajillion times when I started using InfoPath) was understanding that rules fire when a field changes. So in this case, Total Project Score would have to change before these rules fire.

    Instead, you should probably put your rules on alignment, profit margin, production support and material obsolescence. And I know - that seems like a lot of work to put the same rules on all these fields! The other option is to come up with a formula for the default value of Total Project Score that takes your caveat into account, but that can be a little tricky. I'm attaching a sample that does this - save the file locally, right click and select design to open in design mode - from there you can preview and try it out. I'm guessing you may have repeating data in your form so I included two versions.

    Hilary Stoupa

  • 10-22-2014 08:38 AM In reply to

    Re: Translation of Excel IF/OR into INFOPATH

    Hi Hilary - Thank you so much for your sample file. That really helps. I will try it out in my completed form and keep you posted if I run into any further issues

    I thought it was really cool that in your verison you did not use any rules but just a clever way of writing the formula for total project score.

    I would never have guessed it

    Regards,

     - Sachin

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