Concatenate total amount of a repeating table - InfoPath Dev
in

InfoPath Dev

Concatenate total amount of a repeating table

Last post 07-07-2015 11:57 AM by Kharrison. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 07-06-2015 10:18 AM

    Concatenate total amount of a repeating table

    I have a repeating table with an 'Amount' field and I have a 'Total' field to sum all amounts. Separate from these, I have another field that I'm trying to concatenate the total sum from the 'Total' field with another date field on the form. This is how I did that: Date field: concat(substring(pay_date, 6, 2), "/", substring(pay_date, 9, 2), "/", substring(pay_date, 3, 2)) So, I'm wanting to concatenate the date with the total in a separate field. And this is how I'm doing that: concat(total,date) If my total has cents greater than zero, it is fine. But if I don't have cents, it drops the decimal with the zeros. Is this even possible?
  • 07-07-2015 08:00 AM In reply to

    Re: Concatenate total amount of a repeating table

     Do you need this in a field? Or could you just use two calculated values on the form, one next to the other? Then you could format one field as a decimal (including keeping the two zeros) and other as a date....

    Hilary Stoupa

  • 07-07-2015 08:09 AM In reply to

    Re: Concatenate total amount of a repeating table

    Hi Hilary, Thanks for replying. I've created two separate fields; one for date and the other for the sum of all 'Amount' fields in the repeatable table formatting to include the decimals. The concat works fine, but only works when there is actual cents involved, e.g. 23.52; but when there are not cents, e.g. 23.00, it drops the zeros and round to 23. See below: eval(eval(group1, "concat(/my:myFields/my:wire_total, /my:myFields/my:inv_no_format)"), "..") Wire_total is the sum of all 'Amount' fields in the repeatable table which drops the zeros. inv_no_format is the date field which is fine. Thanks,
  • 07-07-2015 08:15 AM In reply to

    Re: Concatenate total amount of a repeating table

    In a nutshell, I'm trying to get 23.0007/07/15. Thanks,
  • 07-07-2015 08:18 AM In reply to

    Re: Concatenate total amount of a repeating table

    I'll see if I can clarify what I was trying to say. Your number is being stored as a number - but when you are formatting the "Amount" field on the form, it is set to include the decimal. That formatting is something separate from the actual value. The formula you are using is only going to return the actual value. So if it were 23.50, you would see 23.5. If you look at the XML in a text editor, you'd see that the amount is actually 23 or 23.5 in the cases where you aren't seeing as many decimal places as you wish.

    This could probably be done with some substring formulas - if I get a chance later today, I'll try to put together a sample. 

     

    Hilary Stoupa

  • 07-07-2015 08:23 AM In reply to

    Re: Concatenate total amount of a repeating table

    Ok... Thank you.
  • 07-07-2015 08:41 AM In reply to

    Re: Concatenate total amount of a repeating table

     I'm confused as to why you are using a double eval in your formula. It appears the fields in your concat statement in the double eval are not in your repeating group?

    At any rate, here's a sample that has a calculated value that should always return two decimals that may help you with this. Save it locally, right click and select design to open in design mode. From there you can preview and type a number w/ or w/out a decimal in the field on the form. 

     

    Hilary Stoupa

  • 07-07-2015 09:06 AM In reply to

    Re: Concatenate total amount of a repeating table

    Thanks Hilary... I'll try and let you know.
  • 07-07-2015 09:20 AM In reply to

    Re: Concatenate total amount of a repeating table

    Perfect! Perfect! Perfect! Thank you so much!
  • 07-07-2015 11:15 AM In reply to

    Re: Concatenate total amount of a repeating table

    One last thing... The formula is working fine but I'm now getting 1.25.07/07/15 (two decimals) when there are cents. Any suggestions? Thanks.
  • 07-07-2015 11:50 AM In reply to

    Re: Concatenate total amount of a repeating table

     Whoops. :)

    Here's a fixed version. 

    Hilary Stoupa

  • 07-07-2015 11:57 AM In reply to

    Re: Concatenate total amount of a repeating table

    IT WORKED!!!! :) You are awesome!!! Thanks Hilary.
Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.