Forum Discussion

ak77's avatar
ak77
Post Patron
3 years ago

Add column and rows to source table

Hi All,

i have the below Source table. i need to add 2 rows for each row in the output table with 2 extra columns as below

Source table

portfolio_codeclass_scheme_codeclass_scheme_node_nameclass_scheme_node_name_benchmarkclass_scheme_node_codedate_fromdate_tocontribution_basesequencereturn_portfolio_baselog_portfolio_baselog_benchmark_baselog_contribution_baseExcess_ReturnExcessReturnsHeaderclient_nameclient_typePortfolio_Node_Name_OverrideBenchmark_Node_Name_Override
PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/01/202301/01/20230.000.002.001.000.00001002000100.00Excess ReturnsClientPReal Estate 
PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/02/202301/02/20230.000.002.001.000.00001021000150.00Excess ReturnsClientPReal Estate 
PORTPORTCSEQEQ BenchmarkCDNEQ01/02/202301/02/20230.000.005.001.000012050200.00Excess ReturnsClientP  

 

 

New Column: Asset will have data from class_scheme_node_name,class_scheme_node_name_benchmark and ExcessReturnsHeader columns

New Column: Returns will have data from log_portfolio_base,log_benchmark_base and Excess_Return columns

 

all the other columns will be repeated in the extra 2 rows added. 

 

Please help

 

output table

AssetReturnsportfolio_codeclass_scheme_codeclass_scheme_node_nameclass_scheme_node_name_benchmarkclass_scheme_node_codedate_fromdate_tocontribution_basesequencereturn_portfolio_baselog_portfolio_baselog_benchmark_baselog_contribution_baseExcess_ReturnExcessReturnsHeaderclient_nameclient_typePortfolio_Node_Name_OverrideBenchmark_Node_Name_Override
REAL ESTATE100PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/01/202301/01/20230.000.002.001.000.00001002000311.00Excess ReturnsClientPReal Estate 
REAL ESTATE Benchmark200PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/01/202301/01/20230.000.002.001.000.00001002000311.00Excess ReturnsClientPReal Estate 
Excess Returns311.00PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/01/202301/01/20230.000.002.001.000.00001002000311.00Excess ReturnsClientPReal Estate 
REAL ESTATE102PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/02/202301/02/20230.000.002.001.000.00001021000314.00Excess ReturnsClientPReal Estate 
REAL ESTATE Benchmark100PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/02/202301/02/20230.000.002.001.000.00001021000314.00Excess ReturnsClientPReal Estate 
Excess Returns314PORTPORTCSREAL ESTATEREAL ESTATE BenchmarkREALEST01/02/202301/02/20230.000.002.001.000.00001021000314.00Excess ReturnsClientPReal Estate 
EQ150PORTPORTCSEQEQ BenchmarkCDNEQ01/01/202301/01/20230.000.005.001.0000150250315.00Excess ReturnsClientP  
EQ Benchmark25PORTPORTCSEQEQ BenchmarkCDNEQ01/01/202301/01/20230.000.005.001.0000150250315.00Excess ReturnsClientP  
Excess Returns315PORTPORTCSEQEQ BenchmarkCDNEQ01/02/202301/02/20230.000.005.001.000012050315.00Excess ReturnsClientP  

2 Replies