I am failing the test in question 1.3. I don’t understand where I am making a mistake. My code with the schema and count of my lap table:
.f1.createLapTable:{[eventInput;sensorInput]
uniqueSensor: distinct select sensorId from sensorInput;
rack:(select from eventInput) cross uniqueSensor;
w:(rack[`time];rack[`endTime]);
f:wj[w;`date`sensorId`time;select from rack;(select from sensorInput;(avg;`sensorValue))];
f:select date,session, lapId, time, endTime, sensorId, sensorValue from f;f
}
I’ve took a look at your ‘.f1.createLapTable’ function and I’ve made a few adjustments:
.f1.createLapTable:{[eventInput;sensorInput]
uniqueSensor: distinct select sensorId from sensorInput;
rack:(select from eventInput) cross uniqueSensor;
w:(rack[time];rack[endTime]);
f:wj[w;datesensorIdtime;select from rack;(select from sensorInput;(avg;sensorValue))];
delete date from f
}
To retrieve a column from a table you must use bracket notation with a backtick as follows - w:(rack[`time];rack[`endTime]); *Example provided below*
It states in the .f1.createLapTable function template that it wants a table returned with the following columns: `session`lapId`time`endTime`sensorId`sensorValue. Hence why the delete statement for date was included at the end.