Fundamentals Capstone 5.2 length error

https://learninghub.kx.com/forums/topic/fundamentals-capstone-5-2-length-error

5.1 is correct and passes and I'm stuck with a length error for 5.2.

Here is my code:

avgEdgePerOption: select avgEdge: avg edge by option_id from trade where date = last date

edgeProfile: select numTrds: count i, avgEdge: avg edge, minQty: min qty, maxQty: max qty by option_id from trade where date = last date, edge > avgEdgePerOption[`avgEdge]

Hi @Kenan

The problem lies with your last bit of code ‘edge > avgEdgePerOption[avgEdge]’.
You are only able to index into a dictionary, not a table. So as avgEdgePerOption returns as a table, when you run ‘avgEdgePerOption[avgEdge]’ it returns nothing (screenshot below).

This is what causes the length error as edge is a list and avgEdgePerOption[`avgEdge] is an empty dictionary.

Hope this helps!

Thanks,

Megan?

Hi Megan,

Thank you for your help. I pass all the tests but format for 5.2.

This is my code:

edgeProfile: select numTrds: count i, avgEdge: avg edge, minQty: min qty, maxQty: max qty by option_id from trade where date = last date, edge > avg edge

I attached the test results and my schema for edgeProfile.