Advanced Capstone 1.3 test fail.

https://learninghub.kx.com/forums/topic/advanced-capstone-1-3-test-fail

I don’t understand why my 1.3 test is failing. Please find a copy of my code and a picture of my test results attached.

Thanks.

.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;rack;(select from sensor;(avg;`sensorValue))];
f:select session, sensorId, lapId,time,endTime,sensorValue from f;
f

}

Hi,

Within your window join, you are selecting from sensor instead of the sensorInput parameter you've passed into the function. This could be what is creating incorrect values in your table.

Hope this helps!

Laura

I edited my wj to select the sensorInput but my code still fails the test.


.f1.createLapTable:{[eventInput;sensorInput]

uniqueSensor: distinct select sensorId from sensorInput;

rack:(select from eventInput) cross uniqueSensor;

w:(rack[time];rack[endTime]);

f:wj[w;sensorIdtime;rack;(select from sensorInput;(avg;`sensorValue))];

f:select date, session, sensorId, lapId,time,endTime,sensorValue from f;f

}

My lap count and schema.