insert formula accumulative sum - InfoPath Dev
in

InfoPath Dev

insert formula accumulative sum

Last post 09-10-2009 03:30 PM by Hilary Stoupa. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 06-16-2009 01:32 PM

    • idali
    • Not Ranked
      Male
    • Joined on 06-10-2009
    • canada
    • Posts 13

    insert formula accumulative sum

    Hello ,
    I m new to InfoPath I used to get all answers looking here in this wealth forum.
    I have a repeating table with a dropdown list to choose a project name
    Date -----Project------time
    -------------------------  total time
    One can fill out the form by picking a date, choosing a Project and adding time. The total time appear as sum of times
    Date1 -----Project1------time1
    Date2 -----Project2------time2
    Date3 -----Project1------time2
    -------------------------  total time
    What I want to do is to have automatically the accumulative time for each project that appear in the last repeating table
    Project1 ----totaltime
    Project2 ----totaltime
    Project3 ----totaltime
    The simplest way is to create a new table with all projects and make a conditional sum but I have a lot of project and I want to display only the active ones!
    Any idea

  • 06-16-2009 06:22 PM In reply to

    Re: insert formula accumulative sum

    Hi:

    When you say you only want to display the active project, can you tell me more about what you mean? You can use an expression box to create a conditional sum (unless this is a browser based form, in which case you'll have to add another field with a default value). Your formula for that expression would vary according to your data structure. There is a sample form here that may help you.

    It uses additional fields that have default values that are filtered, but I think it will give you an idea or two...
    Hilary Stoupa

  • 06-17-2009 07:08 AM In reply to

    • idali
    • Not Ranked
      Male
    • Joined on 06-10-2009
    • canada
    • Posts 13

    Re: insert formula accumulative sum

    Hi Hilary,

    thank you very much it's exactly what i was looking for , i'm trying right now to adapte it to my Form (using additional fields that have default values that are filtered)

    thanks

  • 06-18-2009 09:52 AM In reply to

    • idali
    • Not Ranked
      Male
    • Joined on 06-10-2009
    • canada
    • Posts 13

    Re: insert formula accumulative sum

    Hi Hilary,

    In the Sample ,@name is used tow times in drop down box proprieties  : for the value and name

    value---->@name

    ..name--->@name

    in this case the expression box shows the name,

    but if i use a Id for the Value (value---->@id) the expression box shows the Id instead of Name 

    how can i convert do Id to show the name instead

    thanks

  • 06-18-2009 10:48 AM In reply to

    Re: insert formula accumulative sum

    This depends on where your drop down gets the list of values / display names. If they are manually entered into the list, we need to do some conditional values for our expression box. If they come from a secondary data source, it is a bit easier -- where do your drop downs get their list from? I'll post a modified sample for you....

    Hilary Stoupa

  • 06-18-2009 11:02 AM In reply to

    Re: insert formula accumulative sum

    Saw your other post, please see the sample attached to this post.

    Right-click on the link in the header and select save as to save locally. Right click on the saved file and select Design to open in design mode, then preveiw.

    Hilary Stoupa

  • 06-18-2009 12:51 PM In reply to

    • idali
    • Not Ranked
      Male
    • Joined on 06-10-2009
    • canada
    • Posts 13

    Re: insert formula accumulative sum

    Hi Hilary,

    thanks for your advices thats works all the time.

    i have a question about formula and xpath :after editing the formulat : @name[@id = current()/Client]

    the xpath is:

    xdXDocument:GetDOM("clientnames")/clients/client/@name[xdXDocument:GetDOM("clientnames")/clients/client/@id = current()/my:Client]

    and the expressionBox display  the first  items whatever the choice from the dropdownbox

    once i change a part by ".."  and the xpath became:

    xdXDocument:GetDOM("clientnames")/clients/client/@name[../@id = current()/my:Client]

    the expression box display exactly the item chosen in the dropdownbox. 

  • 06-18-2009 03:34 PM In reply to

    Re: insert formula accumulative sum

    I'm sorry, I'm a little confused -- do you have this resolved for your form?

    Hilary Stoupa

  • 06-18-2009 04:26 PM In reply to

    • idali
    • Not Ranked
      Male
    • Joined on 06-10-2009
    • canada
    • Posts 13

    Re: insert formula accumulative sum

    hi Hilary 

    yes, i use the sample and now it works,

    my last question was only to know what is the difference between the tow xpath getting from the same formula

    thank you very much

  • 09-08-2009 01:27 PM In reply to

    Re: insert formula accumulative sum

    Do you have an sample of this for InfoPath 2003?

  • 09-08-2009 02:23 PM In reply to

    Re: insert formula accumulative sum

    I've attached a copy saved as IP 2003 format. Let me know if gives you any trouble.

    Hilary Stoupa

  • 09-09-2009 07:48 AM In reply to

    Re: insert formula accumulative sum

    The items are only showing up once in the summary but it isn't totaling for me.  Any suggestions?

  • 09-10-2009 03:30 PM In reply to

    Re: insert formula accumulative sum

    I vaguely remember that IP2003 had some .... oddities .... when trying to use the current() function in a default, which the sample I posted relies on. I'm not too sure of a good work around for that. If you know in advance how many choices your users would have, and what the values would be, you could simply use sums with filters -- like sum(dollarValueNode[../itemNode = 'ItemA']), but it loses its dynamic qualities.

    Hilary Stoupa

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