https://learninghub.kx.com/forums/topic/advanced-capstone-2-3
Hello! I have checked previous posts on this question, but still have not managed to figure out the issue, as I get the mismatched type error on the function and 3/4 tests failed. My guess is that the error is due to the wrong datatype for the 3rd sensor parameter, but I worked both with symbol and string and got the same error (a screenshot of the code and error is attached - the whole code can be seen inside the spoiler tag).
.f1.checkSensor{[raceTab; lapTab; mySensor]
sensorFilter:`temp`tyre`wind`all!("temp*";"tyre*";"wind*";"*e*");
// Get avg benchmark values from historical lap data
benchmark: ?[lapTab;
enlist(in;`sensorId;(sensorFilter;enlist mysensor));
(enlist `sensorId)!enlist `sensorId;
(enlist `benchmarkValue)!enlist (avg;`sensorValue)];
chk: ?[raceTab;
(enlist(in;`sensorId;(sensorFilter;enlist mysensor)));
(enlist `sensorId)! enlist `sensorId;
`avgValue`stdDevValue!((avg;`sensorValue);(dev;`sensorValue))];
// Join historical benchmarks to new data and calculate diff
chk:update diffValue:"F"$.Q.f'[5;abs[benchmarkValue-avgValue]]
from benchmark lj chk;
// Add flags if difference between old vs new data >1 and if standard deviation>1.5
chk:update diffFlag:?[(diffValue>1);0b;1b],
stdFlag:?[(stdDevValue>1.5);0b;1b]
from chk;
chk
}