# Canvas Issue - math

**URL:** <https://discuss.elastic.co/t/canvas-issue-math/299090>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [March 8, 2022, 12:46pm UTC](https://discuss.elastic.co/t/canvas-issue-math/299090 "2022-03-08T12:46:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulaCM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulacm/32/102756_2.png) [@PaulaCM](https://discuss.elastic.co/u/PaulaCM)\
**Post date:** [March 8, 2022, 12:46pm UTC](https://discuss.elastic.co/t/canvas-issue-math/299090/1 "2022-03-08T12:46:17Z")

</div>

Hey! I don't know if someone got this issue or knows how to help:

I am doing a SQL query which is working fine:  
// SELECT COUNT(DISTINCT "idVisit") FROM "test"

but when displaying an error appears  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9bbfc44576e4fbedeb265d1b7f95453e0060adfe.png)  
"Whoops! Expression failed with the message:  
[math] \> Unknown variable: country"

I don't know why this error appears (country is another variable in the dataset, but not one I'm interested in showing now) since this is not a variable I'm using in the SQL query.

Any help is appreciated!  
Paula

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 10, 2022, 3:54pm UTC](https://discuss.elastic.co/t/canvas-issue-math/299090/2 "2022-03-10T15:54:35Z")

</div>

You need to remove and add the `Measure` property. It's easier to understand if you enable the `Expression editor`.

![Peek 2022-03-10 16-52](https://us1.discourse-cdn.com/elastic/original/3X/5/c/5c046303cfd23505fa224a1f9f383d027f7f7a9c.gif)

I think this is a regression I will open an issue to confirm with my colleagues.

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 10, 2022, 4:07pm UTC](https://discuss.elastic.co/t/canvas-issue-math/299090/3 "2022-03-10T16:07:24Z")

</div>

Reported at [Canvas: measure value not updating when changing from demo data · Issue #127482 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/127482)

---

<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:** [April 7, 2022, 4:07pm UTC](https://discuss.elastic.co/t/canvas-issue-math/299090/4 "2022-04-07T16:07:33Z")

</div>

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