Expand my Community achievements bar.

Pls Help! Compare two numeric fields (sums)--greater or lesser shows different image

Avatar

Level 1

In my PDF form: I have two columns (A and B) each with 10 fields where the user selects values of 1 through 5 for each.  I have two fields at the bottom of each column: SumA and SumB.  I need to be able to compare the two summed fields --SumA and SumB (which is greater/lesser, etc) and depending on which one is greater, show a particular image. 

Does anyone know how to do this?

Any and ALL help will be greatly appreciated!

Thanks!

1 Reply

Avatar

Level 7

Firstly I would name all your rows (except the total) the same thing eg. Row1. Then for the total cells at the bottom you could put in formcalc in the calculate event of each total cell:

$ = sum(Row1[*].Cell1) // or whatever the row and cells are called.

Then you could put in the layoutReady event in formcalc:

if (Table1.Row4.Cell1[1] > Table1.Row4.Cell1[0]) then // renaming to whatever your total cells are called

Image1.presence = "visible"

Image2.presence = "hidden"

elseif (Table1.Row4.Cell1[0] > Table1.Row4.Cell1[1]) then

Image1.presence = "hidden"

Image2.presence = "visible"

endif