Hi community!
I am currently a student of VBA and we have a question by our professor, which nobody is able to solve. So this is why I would love to ask you all for help, I will copy the task below:
-------
We use the pseudo-code below to merge 2 datasets. Dataset 1 is already imported and will be store in the array v1(). Dataset 2 will be read and stored in the array v2().
We want to merge the 2 datasets using a key variable, assuming that all values in the key variable are unique. The data is described below.
Your task is to choose a position and insert the merge condition.
Example: (1) If cat > dog
Please respect the spacing after each symbol, and insert only the condition with no further keyword.
The pseudo-code indicates only the main steps, other necessary steps might not be shown:
[Import data to array v1]
[Declare array v2]
[Open data 2 file]
[Open Do loop]
Line = Split[Data row]
d1 = Line(0)
(1)
[Convert d1 into date]
(2)
[For loop] with index k
(3)
Next
(4)
row = row + 1
[Assign values to array v2]
(5)
[Close Do loop]
(6)
The array v1() stores the variables in the following order : dates(1), ticker(2), bid(3), ask(4), price(5), returns(6).
The dataset 2 contains variables in the following order : dates(1), ticker(2), bid(3), ask(4), price(5), returns(6).
We merge by using the key variable “ticker”
-------
Thanks a lot if you could help solve this problem!
Best
Pete DeBruy
Bookmarks