Hi,
I have below dataset:
NAME | AGE | Amount | Revenue | Sale | Column |
SMITH | 30 | 100 | 1000 | 10000 | Amount |
CLARK | 32 | 200 | 2000 | 20000 | Sale |
BLAKE | 35 | 300 | 3000 | 30000 | Sale |
KING | 48 | 400 | 4000 | 40000 | Revenue |
SCOTT | 43 | 500 | 5000 | 50000 | Amount |
MILLER | 55 | 600 | 6000 | 60000 | Revenue |
I want additional column "Final Value" as output which gives me the value based on "Column" column, Which contains field name.
Using this fieldname i want to update the "Final Value" column. For example in above table in "Column" filed value is Amnount. So "Final Value" for this entry consider the velue from "Amount" Field. i.e. 100. If Sale then "Final Value" come from sale column.
Note : I dont know value in column filed. i mean i dont want to implement logic like if column = 'Amount' then [Amount] if column = 'Sale' then [Sale]. I want to implement the logic in dynamic way.
Expected output ( Refer the Final Value column in below table)
NAME | AGE | Amount | Revenue | Sale | Column | Final Value |
SMITH | 30 | 100 | 1000 | 10000 | Amount | 100 |
CLARK | 32 | 200 | 2000 | 20000 | Sale | 20000 |
BLAKE | 35 | 300 | 3000 | 30000 | Sale | 30000 |
KING | 48 | 400 | 4000 | 40000 | Revenue | 4000 |
SCOTT | 43 | 500 | 5000 | 50000 | Amount | 500 |
MILLER | 55 | 600 | 6000 | 60000 | Revenue | 6000 |
Thank you in advance.
Solved! Go to Solution.
Hello Felipe_Ribeir0,
It works. Thank you for your quick assistance :)
Hello ArtApa,
Thank you for your help. This approach is also works.