# error: "test.testTab" (FP.Functions.test/classifyTrades.quke:3)

**URL:** <https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229>\
**Category:** Academy Support\
**Tags:** imported\
**Created:** [September 10, 2023, 12:00am UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229 "2023-09-10T00:00:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bl1](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bl1](https://forum.kx.com/u/bl1)\
**Post date:** [September 10, 2023, 12:00am UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/1 "2023-09-10T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/error-test-testtab-fp-functions-test-classifytrades-quke3](https://learninghub.kx.com/forums/topic/error-test-testtab-fp-functions-test-classifytrades-quke3)

Hi,

Is the classifyTrades.quke correct?

I get the error: abort in before block due to error “test.testTab” (FP.Functions.test/classifyTrades.quke:3).

My classifyTrades function is ok when I run it against tradeContext table.

When I replaced test.expTab and test.testTab to expTab testTab inside classifyTrades.quke, then the test is passed.

---

<div class="post-metadata">

**Author:** ![mmcparland](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/mmcparland/32/54_2.png) [@mmcparland](https://forum.kx.com/u/mmcparland)\
**Post date:** [September 20, 2023, 12:00am UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/2 "2023-09-20T00:00:00Z")

</div>

Hi ,

Sorry for the delay in response, it’s because you didn’t define your function as ‘classifyTrades’.

I defined the function and the tests passed.

Thanks,

Megan

---

<div class="post-metadata">

**Author:** ![bl1](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bl1](https://forum.kx.com/u/bl1)\
**Post date:** [October 16, 2023, 12:00am UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/3 "2023-10-16T00:00:00Z")

</div>

I logged in again to test the suggested solution. Now I cannot reproduce the error, no matter if I define the function name or not

---

<div class="post-metadata">

**Author:** ![bl1](https://avatars.discourse-cdn.com/v4/letter/b/3be4f8/32.png) [@bl1](https://forum.kx.com/u/bl1)\
**Post date:** [September 12, 2023, 12:00am UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/4 "2023-09-12T00:00:00Z")

</div>

Hi Megan,

&nbsp;

```
{[tab]
    //Pseudocode:
    //Performing an update will keep the original table
    //When classifying, need to first check the side
    //If side is Buy, then a good trade was bought for less than what the market was asking for
    //If side is Sell, then a good trade sold for more than what the market was bidding for
    //The vector conditional might prove useful   
    s: exec side from select side from tab;
    b: exec bid from select bid from tab;
    a: exec ask from select ask from tab;
    p: exec price from select price from tab;
    exQuality: ?[s=`B;?[pb;1b;0b]];
    new: update exQuality from tab
    }
```

---

<div class="post-metadata">

**Author:** ![mmcparland](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/mmcparland/32/54_2.png) [@mmcparland](https://forum.kx.com/u/mmcparland)\
**Post date:** [September 11, 2023, 12:00am UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/5 "2023-09-11T00:00:00Z")

</div>

Hi !

To help me better assist you, can you send me your code for classifyTrades?

You can do this using the spoiler tag or you can dm me!

Thanks,

Megan

---

<div class="post-metadata">

**Author:** ![maxzy](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/maxzy/32/128_2.png) [@maxzy](https://forum.kx.com/u/maxzy)\
**Post date:** [September 24, 2025, 10:50pm UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/6 "2025-09-24T22:50:02Z")

</div>

Hi, i seem to have the same issue. I have the function defined:

/s classifyTrades:{[initTable] newTable : update exQuality :?[side = `S; ?[price \> bid; 1b; 0b]; ?[price \< ask; 1b; 0b]] from initTable;:newTable;} /s

---

<div class="post-metadata">

**Author:** ![mmcparland](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/mmcparland/32/54_2.png) [@mmcparland](https://forum.kx.com/u/mmcparland)\
**Post date:** [September 25, 2025, 12:09pm UTC](https://forum.kx.com/t/error-test-testtab-fp-functions-test-classifytrades-quke-3/13229/7 "2025-09-25T12:09:18Z")

</div>

Hi @maxzy

I ran the classifyTrades.quke file against your code and it passed the test. Are you receiving a different output?
