Jump to content
  • 0

Calculation based on two existing calculated fields.


gregcoiro

Question

Hello,

I have two datapages embedded into one single external html page. Each datapage performs a total sum calculation. I would like to then be able to do a simple calculation off of these two calculated values. I am looking to essentially do the following:

[CalculatedField1] - [CalculatedField2] = Result

Is there a piece of Javascript I can insert into the actual external HTML page?

Also, if this is possible, can I write a message if [CalculatedField2] is greater than [CalculatedField1]?

Thank you in advance from a long-time and very loyal Caspio client.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

This is possible with Javascript. What you will want to do is get the last TR of the table. This last TR holds the Total values. Those values must be stored into a variable. Once you have them into the variables you can easily perform other calculations.

I am not 100% sure this is the correct code, but something like this can be used to get the last TR value:

var lastRowIndex = table.rows.length-1;

http://stackoverflow.com/questions/9609 ... e-last-row

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...