[Translation] Use formulas in infopath repeated tables to filter the minimum value data

Source: Internet
Author: User
Use formulas in infopath repeated tables to filter minimum data

By s.y. M. Wong-a-ton

Learn how to use formulas in infopath without usingCode) To find the minimum value of a column in the duplicate table and highlight it.

 

Requirements:

When you create a duplicate table, which contains a number column, you want to find and highlight the rows with the minimum values. How can this problem be solved?

 

Solution:

You can use the formula and condition format to find these minimum values.

Steps:

Example:

  1. In infopath 2007, create a new emptyTemplate.
  2. Add a duplicate table and the table contains a hidden column. (For example, field2. You can create a three-column duplicate table and delete the middle column ).
  3. Convert the first column of the tableDate Selector.
  4. On the data source panel, right-clickMyfields NodeAdd a node namedMindateAnd setThis node is of the date type., As shown in

    Figure 1. Repeating table with date and hidden fields and the main data source in infopath design mode.

     

  5. On the data source panel, double-click the field you hidden in the duplicate table to open its properties dialog box. In this example, this field isField2
  6. InDomain or group attributesIn the dialog box, click the formula button, FX.
  7. In the insert formula dialog box, selectEdit XPath (advanced)Select box ..
  8. In the insert formula dialog box, copy and paste the following formula into the formula text box:

    Substring (.. /My: field1, 9, 2) + (153 * (substring (.. /My: field1, 6, 2) + 12 * (14-substring (.. /My: field1, 6, 2) Div 12)-3) + 2) Div 5) + 365 * (substring (.. /My: field1, 1, 4) + 4800-(14-substring (.. /My: field1, 6, 2) Div 12) + (substring (.. /My: field1, 1, 4) + 4800-(14-substring (.. /My: field1, 6, 2) Div 12) Div 4)-32083

    In the first columnField1(It is a date selector control), that is, you want to find the minimum value.

  9. ClickOKClose all dialog boxes.
  10. InData SourceIn the panel, double-clickMindateField to open its properties dialog box.
  11. InDomain or group attributesIn the dialog box, click the formula button next to the value text box.
  12. InInsert FormulaIn the dialog box, selectEdit XPath (advanced)Select box.
  13. InInsert FormulaDialog box, copy and paste the following formula to the formula text box:

    .. /My: group1/My: group2/My: field1 [.. /My: field2 = xdmath: min (/My: myfields/My: group1/My: group2/My: field2)]

     

  14. ClickOKClose all opened windows
  15. Double-clickDate SelectorControl, openAttributeWindow
  16. InDate selector attributes, SelectDisplayTab, and then clickCondition format.
  17. InCondition formatIn the dialog box, click Add.
  18. InCondition formatDialog box, add two conditions:

    Field1 equals mindate

    And

    Mindate is not empty

     

  19. InCondition formatDialog box, select a color for the shading, and then clickOK.
  20. ClickOKClose all open dialog boxes.


Figure 2. Selecting the minimum date in a column of a repeating table in infopath.

Success! When you add a new row in the duplicate table, the minimum value is displayed.

 

This solution also applies to browser-compatible formsInfopath 2007 browser forms.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.