terryp
December 27, 2023, 12:00am
1
https://learninghub.kx.com/forums/topic/fundamentals-capstone-ex-2-2
I literally do not know why it keeps sending me types mismatch error. Is there any reference link about what types mismatch error means. have been encountering types errors every time, but every time the issue came from different contexts which are a bit frustrating.
Laura
December 28, 2023, 12:00am
2
Hi when I try to run your function I get a error “brokerID” not a types mismatch. Here’s a few things I noticed:
if function checks is statement true: then executes all subsequent statements if true.
if the statement is false: do not evaluate the subsequent statements and continue to the next q expression.
It seems you are trying to do if-else here - have a look at conditional evaluation using $
- question asks for result to be returned in type long - not string (need to cast here)
colon in wrong place on the last line
I would recommend the Fundamentals courses to learn the basics on Execution Control - using if and if-else
extractBrokerId:{[exMsg] parts: “-” vs exMsg; exch: parts 0; $[exch like “CME*”; brokerId:parts 2; brokerId: parts 1]; :“J”$brokerId}