Dear Experts,
I have a master table, tableTotal. Initially it is empty.
portfoliot0 is a table of two columns
portfoliot0 stockName weight Apple 10 IBM 90
It is then assigned to tableTotal.
TableTotalstockName portfoliot0Apple 10IBM 90
Now portfoliot0 has new stocks and weights
portfoliot0 stockName weight Apple 20 Groupon 80
Hence TableTotal will need to shift while portfoliot0 is appended to it.
TableTotal stockName portfoliot0 portfoliot1 Apple 20 10 Groupon 80 0 IBM 0 90
Now portfoliot0 has new stocks and weights
portfoliot0 stockName weight Citi 30 Goldman 70
TableTotal will need to shift while portfoliot0 is appended to it. This is the result
TableTotal stockName portfoliot0 portfoliot1 portfoliot2 Apple 0 20 10 Groupon 0 80 0 IBM 0 0 90 Citi 30 0 0 Goldman 70 0 0
I have to repeat the above 20 times till it becomes first in, last out. Meaning it will have maximum 20 columns. Once it reaches 20 columns, every new data will result the oldest data to be discarded.
I cant assign portfoliot"i" where "i" is a variable. Do i need to use eval?
Thank you very much for your advice LL
Best Answer