Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Do calculation on fieldname

Dear all,

I would like to turn Table A into Table B with below logic.

Table A:

ProductDurationDue Fail1-1112-2223-33
A105270
B204013
C108460
D2010621

Table B:

ProductDurationDue Fail1-1112-2223-33
A107 (5+2)700
B205 (4+0+1)300
C1012 (8+4)600
D2018 (10+6+2)100

For example,

Product A with Duration 10 in Table A,

The lower limit in column 1- 11 is 1, after minus 10 is less than 1,

then it fall into the column "Due Fail" and sum with the value in "Due Fail" ,

else

if the lower limit in column 12- 22 is 12, after minus 10 is equal to 2, it will fall into range "1-11",

then it fall into the column "1-11" but do not need to sum the original value in "1-11"

2 in "1-11" in Table A will fall into the column "Due Fail" and sum with the original value 5

7 in "12-22" in Table A will fall into the column "1-11" .

Product B with Duration 20

if the lower limit in column 1- 11 is 1, after minus 20 is less than 1,

then it fall into the column "Due Fail" and sum with the value in "Due Fail" ,

else

if the lower limit in column 12- 22 is 12, after minus 20 is less than 1,

then it fall into the column "Due Fail" and sum with the value in "Due Fail" ,

else

if the lower limit in column 23- 33 is 23, after minus 20 is 3, it will fall into the range "1-11",

then it fall into the column "1-11" but do not need to sum the original value in "1-11"


0 in "1-11" in Table A will fall into the column "Due Fail" and sum with the original value 4

1 in "12-22" in Table A will fall into the column "Due Fail" and sum with the original value 4

3 in "23-33" in Table A will fall into the column "1-11"

Is it possible to do it?

Please let me know if further explanation is needed.

In my real case, there is 36 column in range that means the last column is "366+"

Thanks a lot.

Best Regards,

Louis

2 Replies
arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Louis,

I am not getting you what you require could you please add expected output and its calculation in more simpler way

Thanks,

Arvind Patil

Anonymous
Not applicable
Author

Hi Arvind ,

Table B is the expected output. The string of () in "Due Fail" does not needed.

The sceanaio is :

There is a Duration(Number) for each product. The range period belongs to different month.

We need to back day to different month according to the Duration.

Best Regards,

Louis