# Grafana not plotting TEXT on Graph

**URL:** <https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877>\
**Category:** Integrations\
**Created:** [November 2, 2021, 11:02am UTC](https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877 "2021-11-02T11:02:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafluq](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rafluq](https://community.cratedb.com/u/rafluq)\
**Post date:** [November 2, 2021, 11:02am UTC](https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877/1 "2021-11-02T11:02:57Z")

</div>

I am trying to plot a 2D graph in Grafana by this query to my DB:

```auto
SELECT
  time_index AS "time",
  raw
FROM "doc"."test"
WHERE
  $__timeFilter(time_index)
ORDER BY 1

```

But raw field is TEXT type

> CREATE TABLE IF NOT EXISTS  
> “doc”.“test” (  
> “entity\_id” TEXT,  
> “entity\_type” TEXT,  
> “time\_index” TIMESTAMP WITH TIME ZONE,  
> “fiware\_servicepath” TEXT,  
> “ **original\_ngsi\_entity** ” OBJECT(DYNAMIC),  
> “raw” TEXT

How could I cast TEXT type to number?

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [November 2, 2021, 11:11am UTC](https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877/2 "2021-11-02T11:11:53Z")

</div>

Hi @rafluq,

you can try to cast `raw` to an integer:

```auto
SELECT cast('123' as INTEGER);
SELECT try_cast('123' as INTEGER);

```

Also take a look at the documentation for type conversion: [Data types — CrateDB: Reference](https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#type-conversion)

---

<div class="post-metadata">

**Author:** ![rafluq](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rafluq](https://community.cratedb.com/u/rafluq)\
**Post date:** [November 2, 2021, 11:20am UTC](https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877/3 "2021-11-02T11:20:03Z")

</div>

Thank you @jayeff for your answer. Is there no options for float? Float values give me NULL

---

<div class="post-metadata">

**Author:** ![rafluq](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@rafluq](https://community.cratedb.com/u/rafluq)\
**Post date:** [November 2, 2021, 11:24am UTC](https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877/4 "2021-11-02T11:24:53Z")

</div>

Okey, I’m sorry, I tried FLOAT and it works. Thank you very much

---

<div class="post-metadata">

**Author:** ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)\
**Post date:** [November 2, 2021, 11:25am UTC](https://community.cratedb.com/t/grafana-not-plotting-text-on-graph/877/5 "2021-11-02T11:25:27Z")

</div>

You can cast to float as well:

```auto
SELECT try_cast('1.2' as DOUBLE);
SELECT try_cast('5' as DOUBLE);

```

Note that with `try_cast` for incompatible type casts `NULL` is returned.

For example when casting text to double:

```auto
SELECT try_cast('hello' as DOUBLE);

```
