Calculated Field in a Secondary Data Connection - InfoPath Dev
in

InfoPath Dev

Calculated Field in a Secondary Data Connection

Last post 11-16-2007 04:04 AM by adamrharding. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-13-2007 08:59 AM

    Calculated Field in a Secondary Data Connection

     

    Is there a way, without coding, to put a new field into a repeating table that is driven by a secondary data source, where this field performs a calculation on two other fields within each row of the repeating table?  

    For example, I have one column for 2006 and another column for 2007, and what I want to calculate is the variance between the columns.

    I can create a field in the main data source contained within a repeating group and place it in the table, but I only get the results of the first record.   If this is the right methodology for doing this?   If so, what I can't figure out is:  Should I be filtering off the secondary data source or the main data source, and what context does Current() operate in; the repeating table or the main data source?

    Here is the actual calculation:

    xdXDocument:GetDOM("History")/dfs:myFields/dfs:dataFields/tns:StringResponse/tns:StringResult/default/QueryResults/DataRow/Col8
    - xdXDocument:GetDOM("History")/dfs:myFields/dfs:dataFields/tns:StringResponse/tns:StringResult/default/QueryResults/DataRow/Col7

    Thanks for the help.

  • 11-16-2007 04:04 AM In reply to

    Re: Calculated Field in a Secondary Data Connection

    Hi

    I think if I understand you correctly then yes, you can.

    Put a field in the repeating table linked back to your main source.  Set its default value to your sum, but filter both elements by having a field for the row number of the row on the table. 

    I hope this helps

    Cheers

    Adam Harding
    Wales
    UK
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.