how to flag/show differences in rows based on multiple condition checks on columns
Hello Friends and Experts,
I need some help on the following:
I have been trying to develop an app where I need to make different comparisons between different column values.
The input table is as follows:
INPUT TABLE:
BOND_ID
purchase_date
matrutiy_date
VALUE
Type
prev_curr flag ( 1 =curr, 0 = prev)
1234
12/03/2020
31/12/2025
5000
EXT
1
1234
12/03/2020
31/12/2025
4800
INT
0
1112
13/03/2017
31/02/2020
66000
EXT
0
1114
13/03/2021
31/02/2020
70000
EXT
1
Here the BOND_ID is the key and prev_curr_flag is a column which is populated based on my previous period= 01st Dec, 2020 and current period=31st Mar, 2021.
Now, I need to make some comparison like,
1. as for first 2 rows BOND_ID are same for 2 different period, but Type is different then I need to highlight TYPE column for those 2 rows.
2. for row 3, as the BOND_ID does not exist for current period and we can see that it's matured (maturity_date) before current period, hence need to highlight the maturity date column for this row.
2. for row 4, as the BOND_ID does not exist for previous period and we can see that it's purchased (purchase_date) after previous period, hence need to highlight the purchase date column for this row.
I have attached an excel for the input table and expected result. Could you please help how this can be achieved?