Advanced Capstone 1.3 test fial.

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

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

}

 

 

Hi @kenan_davidsonyahoo-com

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.
If you have any questions please let me know!

Thanks,

Megan

Thank you for your help! But after editing 1.3 I was able to pass all sections but when I try and submit I recieve an error for 1.4 and 1.5.

Maybe your lap table still had a date column when it was saved to disk and the column is interfering with the tests?

You could try redefining the lap table and running .Q.dpft and .Q.chk again

It was how I answered 2.2, I added the date col back to the laptable causing 1.4 and 1.5 to fail after completeing question 2.

Thanks