I have the finished 2.1 , 2.2 and 2.3 as following:
2.1 In the optRef table, the expiry column is in a string format. Convert this into the kdb date format.
Help: See Casting
meta optRef
`optRef[`expiry]: "D"$optRef[`expiry]
//optRef
2.2 Create a function extractBrokerId
extractBrokerId:{[exMsg] parts: "-" vs exMsg;
exch: parts 0;
$[exch like "CME*"; brokerId:parts 2; brokerId:parts 1];
:"J"$brokerId
}
//show t1: extractBrokerId["CME-TSLA20200920C1700-709"]
//show t2: extractBrokerId["ISE-708-TSLA20200920C1700"]
2.3. Using the extractBrokerId function (or otherwise), update the messages table
//select broker_id: extractBrokerId each string each exch_message from messages
messages: select trade_id, exch_message, broker_id: extractBrokerId each string each exch_message from messages
//meta messages
but the testSection[`exercise2] shows:
quizItem success description error
exercise2.1 Fail "optRef Has Correct Format" ""
exercise2.2 Fail "instRef Has Correct Format" ""
exercise2.3 Fail "messages Has Correct Format" ""
2.3 the main issue is 1.7 csv load message need be ("**",enlist csv) other than ("SS",enlist csv). and change the select to update as well. it works. thanks.
– yinzhihong12