Sum Problem - InfoPath Dev
in

InfoPath Dev

Sum Problem

Last post 11-11-2019 10:28 AM by Fatihteke. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 11-06-2019 10:44 AM

    Hello Everyone, I found this article. https://www.infopathdev.com/forums/p/11050/39728.aspx In this article Hilary create awesome template which name is summary.xsn. I want to create same thing but not manuely select. I want to do it with list items. Thats why i copyed code and change it like this Original: sum(/my:myFields/my:group1/my:group2/my:field2[../my:field1 = current()/../my:field1]) My Code: sum(xdXDocument:GetDOM("Siparis-Data")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:l8xb[xdXDocument:GetDOM("Siparis-Data")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:xqnm = current()][xdXDocument:GetDOM("Siparis-Data")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:xqnm]) But it return 0. Where is my mistake? I attach xsn.
  • 11-07-2019 07:34 AM In reply to

    The main issue I see here is that field2 is not repeating, so I'd guess it would always display the same value. My guess would be you could use this for your calculated value in the "Filtered" table: sum(../d:SharePointListItem_RW/d:l8xb[../d:xqnm = current()/d:xqnm])
    Hilary Stoupa

  • 11-07-2019 11:22 AM In reply to

    Hello Hilary, Its already like that.I used same code like you.
  • 11-07-2019 11:30 AM In reply to

    That screen shot is of field2, which is not repeating, and doesn't show the XPath, which based on what I saw and what was in the form, is not what I pasted in. Can you try the XPath I pasted in for your expression box in your repeating table? Instead of field2?
    Hilary Stoupa

  • 11-07-2019 11:53 AM In reply to

    Yes Field2 is not repeating table. Because its Count's target. Count is calculated value and Xpath is Filed2. And Field2 formule i write it above. I am confuse because in your example you create field3 and field3 is calculating. I think so my mistake is filed2 must be in rebeating table rigth?
  • 11-07-2019 11:55 AM In reply to

    and if i insert summary column in my sharepoint list i couldn't control it for formule.
  • 11-07-2019 11:59 AM In reply to

    My example is bound to the main data source for a reason. Do you need to store the data the user enters into that count field? Because data entered into secondary data source fields won't get saved when the form is submitted.
    Hilary Stoupa

  • 11-07-2019 12:17 PM In reply to

    Actualy I want to create this form for custormers purchaces. One person will add lines to my list everyday custormers purchaces. My target to sum all products count which have same code. For example today I create 3 order for 3 different customer and products codes is A1,B1,C1. and item count A1=10,B1=20,C1=30 tomorrow i insert to new lines to mo sharepoint list and A1=100,B1=30 and of day manager must to see we need 110 A1 product, 50 B1 product an 30 C1 product. After that manager will give order to producer and request them correct count. 1 week later procuder send A1 and B1 products to us and we click the checkbox "order complate" and we will see only C1 product for complate. This will continue forever.
  • 11-07-2019 03:22 PM In reply to

    Ok. So the data is directly entered into the SharePoint list and you are just using the InfoPath form to display the data summarized. Is that correct? If so - try this copy, where I have added the calculated field for you with the formula I've suggested. Save the form locally. Right click the template and select Design. Then you can preview and see if it works as anticipated.
    Hilary Stoupa

  • 11-10-2019 11:10 AM In reply to

    Yes Hilary its correct. But your formule summirized "Name" I want to for product Numbers. If I change the code for numbers like this "sum(d:l8xb[../d:Title = current()/d:Title])" Its only show first number. not sum.
  • 11-11-2019 07:40 AM In reply to

    sum(../d:SharePointListItem_RW/d:l8xb[../d:Title = current()/d:Title]) - note how my formula goes up to the repeating node to summarize - ../d:SharePointListItem_RW
    Hilary Stoupa

  • 11-11-2019 10:28 AM In reply to

    Hilary I don't know how can i thank you? :) its working as like as i want. Thank you so so much. Best Regards
Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.