I have a dataset where I have different percentages and I have to pick:
1. If the column value is greater than 80 (which has an integer value). I have to pick the column which has a comment on it
For example: First row t1 is 80% for that we have column comment_t1 and I have to pick the value from there
2. If no column value has greater than 80 I have picked the top 2
For example: 2nd row has values 15 (t1) and 8 (t2), It has columns for comment comment_t1 and comment_t2 So I have to pick both the values and put it in the comment column
3. If there is only one value then I have to select the comment column for that.
Example: row 3rd where t2 has value so pick the comment_t3 column
Note: If the t1/t2/t3/t4 column does not have any value but it has a comment in columns Comment_t1/ Comment_t2/ Comment_t3/ Comment_t4 we don't have to consider it
Input:
| ID | description | t1 | Comment_t1 | t2 | Comment_t2 | t3 | Comment_t3 | t4 | Comment_t4 |
| 123 | apple | 80 | Alex | 2.0 | Shane | 3 | Tim | ||
| 123 | apple | 15 | Alex | 8 | Shane | 2 | Drake | Tim | |
| 245 | mango | Alex | 2 | Shane | |||||
| 245 | mango |
Below is the sample output:
| ID | description | t1 | Comment_t1 | t2 | Comment_t2 | t3 | Comment_t3 | t4 | Comment_t4 | comment |
| 123 | apple | 80 | Alex | 2.0 | Shane | 3 | Tim | Alex | ||
| 123 | apple | 15 | Alex | 8 | Shane | 2 | Drake | Tim | Alex,Shane | |
| 245 | mango | Alex | 2 | Shane | Shane | |||||
| 245 | mango | NA |
