Perform automatic operations with customized logic.

Hi guys, I haven't been able to resolve this problem for days, can anyone help me?

TABLE A = USER INPUT TABLE (DATA ENTERED WITH THE FORM)

TABLE A V.JPG

TABLE B = AUTOMATICALLY GENERATED OUTPUT TABLE

TABLE B V.JPG

As you can see I attach the two tables:


1) Table A is a data input table by the user, in this table the customer adds the requested data using the form


2) Table B is an output table, whose records must be automatically generated as you see in the photo. I used colors to highlight concepts. I've inserted these example records into Table B to explain what I need.
In practice, as you can see, I need a new record to be created for each exercise of each week carried out and the tonnage value to be added. In the increase table, however, I would like to make a difference between the values having the same financial year of the previous week with the values of the current week. I left the formulas exposed so you can see everything.

Can anyone tell me how I can do it? If necessary I am willing to restructure the data.

Many thanks in advance.

0 2 159
2 REPLIES 2

Would it be easier to use only one table and make the calculation(s) in an additional column(s) when the program goes forward? Then you could use a slice and filter the 1st session away and some columns as well. The structure would be much simpler.

Thanks, I followed your advice and managed to fill in the "TOTALE TONNELLAGGIO SETTIMANALE" column and set the right formulas. Even if the problem is that it is redundant, I haven't found any other solutions.
Now I'm having serious trouble setting up the formula for the "INCREMENTO" column.
In this column there must be the difference in weight gain divided for each week and for each exercise.
The value from which to take the difference is the TOTALE TONNELLAGGIO SETTIMANALE column, therefore in the first rows where I only have records of the single financial year, the INCREMENTO value must be zero, while in the subsequent cells of the subsequent weeks there must be the difference between the value of TOTALE TONNELLAGGIO SETTIMANALE current and that of the previous week.

So it should work more or less like this:

IF there are records inserted that refer to a single week
THEN
the INCREMENTO value is equal to the TOTALE TONNELLAGGIO SETTIMANALE value
ELSE
IF the value of the SETTIMANA column is different from the value of the current row (always of the WEEK column)
AND
If the value of the ESERCIZIO column is equal to the value of the current row (always of the ESERCIZIO column)
THEN
execute the difference between the value of TOTALE TONNELLAGGIO SETTIMANALE of the current row MINUS the value of TOTALE TONNELLAGGIO SETTIMANALE of the previous week (but of the same value present in the ESERCIZIO column)table c.JPG

Top Labels in this Space