KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Academy Advanced Capstone 1.3 test fial.

  • Advanced Capstone 1.3 test fial.

    Posted by Kenan on April 10, 2024 at 5:49 am

    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
    
    }

     

     

    Kenan replied 7 months, 2 weeks ago 3 Members · 4 Replies
  • 4 Replies
  • megan_mcp

    Administrator
    April 10, 2024 at 10:39 am

    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;`date`sensorId`time;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

Log in to reply.