You are viewing limited content. For full access, please sign in.

Question

Question

Forms 10.4.5.282 -- Calculation error using INDEX(Table.Column,ROW())

asked on June 9, 2022

ERROR: Calculation contains invalid syntax

ERROR: This field contains a calculation error

I am using number fields

"Use thousands delimiter" is unchecked

I'm using:
=SUM(INDEX(Time.HRS,ROW()),(INDEX(Time.KT,ROW()),(INDEX(Time.LB,ROW()),(INDEX(Time.LA,ROW()),(INDEX(Time.HL,ROW()),(INDEX(Time.LWOP,ROW()),(INDEX(Time.Other,ROW()))

Works: =SUM(INDEX(Time.HRS,ROW()))

Doesn't work: =SUM(INDEX(Time.HRS,ROW()),(INDEX(Time.KT,ROW()))

Table name: Time

Table Variables:
Date
HRS
KT
LB
LA
HL
LWOP
Other
Total (this is the sum column)
Desc (not summing this text field)

 

How do I remedy this calculation error?

This field contains a calculation error.png
Timesheet.png
Fields.png
Calculation contains invalid syntax.png
Timesheet.png (22.92 KB)
Fields.png (15.72 KB)
0 0

Answer

SELECTED ANSWER
replied on June 9, 2022

Hi Hope,

I'm afraid the parentheses is not closing correctly, please try

=SUM(INDEX(Time.HRS,ROW()),INDEX(Time.KT,ROW()))

instead of 

=SUM(INDEX(Time.HRS,ROW()),(INDEX(Time.KT,ROW()))

1 0

Replies

You are not allowed to reply in this post.
replied on June 9, 2022

I've also tried

 

$(document).ready(function () {
  $(document).on('blur', 'Time tr td input[type="text"]', function(){
  	var columns = ['HRS','KT','LB','Table.LA','LH','LWOP','Other'];
  	$('Time tr').each(function() {
    	var sum = 0;
    	$(this).find('td').each(function() { 
  			if(columns.indexOf($(this).attr('data-title')) > -1){
              if($(this).find('input[type="text"]').val() =='')
              {
                $(this).find('input[type="text"]').val(0.00).change();
              }
         		sum = sum + parseFloat($(this).find('input[type="text"]').val());
        	}
    	});
      $(this).find('td[data-title="Total"] input[type="text"]').val(sum).change();
  	});
  });
});

I've had no success with INDEX(Table.Column,ROW()) or the java above

You are not allowed to follow up in this post.

Sign in to reply to this post.