# More than 1000 rows in canwas

**URL:** <https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [January 18, 2021, 11:18am UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415 "2021-01-18T11:18:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_Nikolaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexey_nikolaev/32/80704_2.png) [@Alexey\_Nikolaev](https://discuss.elastic.co/u/Alexey_Nikolaev)\
**Post date:** [January 18, 2021, 11:18am UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/1 "2021-01-18T11:18:50Z")

</div>

Try to count call from CISCO CDR. I have QUERY that grouping all call by globalCallID\_callId and I need to COUNT unique globalCallID\_callId - but I have much more records than 1000. My SQL is:

> SELECT globalCallID\_callId FROM "cucm-cdr-full" GROUP BY globalCallID\_callId

and I need to count it based on timestamp.

---

<div class="post-metadata">

**Author:** ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)\
**Post date:** [January 18, 2021, 3:09pm UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/2 "2021-01-18T15:09:43Z")

</div>

the `essql` operator in Kibana Canvas also takes a `count` argument ([here's its doc section](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#essql_fn)) please up it. You may bump into another limitation at 10 000 rows though.

---

<div class="post-metadata">

**Author:** ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)\
**Post date:** [January 18, 2021, 3:11pm UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/3 "2021-01-18T15:11:37Z")

</div>

Also, if possible, do the `COUNT` aggregation with the SQL query, instead of doing it with the Canvas expression language, it has various benefits. Reference to our SQL SELECT is [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-syntax-select.html)

---

<div class="post-metadata">

**Author:** ![Alexey\_Nikolaev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexey_nikolaev/32/80704_2.png) [@Alexey\_Nikolaev](https://discuss.elastic.co/u/Alexey_Nikolaev)\
**Post date:** [January 19, 2021, 7:30am UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/4 "2021-01-19T07:30:09Z")

</div>

I know that I can just count the rows, for example  
**SELECT COUNT (\*) AS TOTAL FROM cucm-cdr-full**, but I need to group them by the **globalCallID\_callId** field before counting, since one phone call can contain several records with the same **globalCallID\_callId** (call transfer from subscriber to subscriber and so on). If it was possible to use a nested query, calculate what is already aggregated, but I don't understand how.

---

<div class="post-metadata">

**Author:** ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)\
**Post date:** [January 19, 2021, 2:01pm UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/5 "2021-01-19T14:01:13Z")

</div>

Could you use the SELECT ... GROUP BY for your case?  
Also, there's a limited form of subqueries (SELECT within a SELECT) now, though I think what you need is the GROUP BY. Apologies if you considered but rejected SELECT ... GROUP BY

---

<div class="post-metadata">

**Author:** ![preetish\_P](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@preetish\_P](https://discuss.elastic.co/u/preetish_P)\
**Post date:** [January 21, 2021, 6:15pm UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/6 "2021-01-21T18:15:20Z")

</div>

@Alexey_Nikolaev  
Did you try this ?:

```auto
SELECT COUNT(DISTINCT globalCallID_callId) AS CT FROM "cucm-cdr-full"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 18, 2021, 6:15pm UTC](https://discuss.elastic.co/t/more-than-1000-rows-in-canwas/261415/7 "2021-02-18T18:15:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
