joins quiz

Hi, for the final question in the joins quiz (getPrevailingLocalQuote) I am getting the correct output but I am still getting a test fail. My code is as follows:

Upon running checkAnswers and failedResults I am met with the following.

 

Is there something I am doing wrong? Any and all would be greatly appreciated as I have spent a considerable amount of time on this one question. 

Hello arooney,

First of all, welcome to FD/KX!

When completing these quizzes, sometimes your code can generate the correct results but if it does not match the expected answer, the test fails. 

Top tip here would be to think of the as-of (aj) join when the intention is to return prevailing quotes. The aj is explained in detail here in the reference card: [https://code.kx.com/q/ref/aj/](“https://code.kx.com/q/ref/aj/” ““https://code.kx.com/q/ref/aj/””) 

So for the getPrevailingQuote, I would do: 

getPrevailingQuote: {aj[(`sym`time);trade;quote]}

and for getPrevailingLocalQuote, I suggest:

getPrevailingLocalQuote: {aj[(cols trade) 3 0 1; trade; quote]}

 This logic works to join the trade and quote table, showing each trade record with the prevailing quote at the time of each trade on that exchange. 

Hopefully this will help you pass the test. 

Kind regards,

Leah 

Thanks very much Leah, a group of us had collectively got it running as a windows join so will try as-of.