# Numeric variable in x axis interpreted as a category

**URL:** <https://community.amazonquick.com/t/numeric-variable-in-x-axis-interpreted-as-a-category/31348>\
**Category:** Q&A\
**Tags:** visuals, formatting, Business-Intelligence-Engineer, quick-sight\
**Created:** [June 14, 2024, 12:34pm UTC](https://community.amazonquick.com/t/numeric-variable-in-x-axis-interpreted-as-a-category/31348 "2024-06-14T12:34:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Badal](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Juan\_Badal](https://community.amazonquick.com/u/Juan_Badal)\
**Post date:** [June 14, 2024, 12:34pm UTC](https://community.amazonquick.com/t/numeric-variable-in-x-axis-interpreted-as-a-category/31348/1 "2024-06-14T12:34:17Z")

</div>

Hey all,

I have created a graph with the cumulative number of calls (y axis) abandoned in a contact center based on the seconds in queue (x axis).

However, the seconds in queue field is being interpreted as a category and the axis does not respect the distance between datapoints (eg. the distance between 1 and 2 seconds is the same between 2 and 38 seconds and this would not make any sense for any dashboard user).

I have checked and my seconds in queue duration is a measure.

Any ideas on how to fix this?

 ![Captura de pantalla 2024-06-14 143304](https://d1wl4jav5dp96l.cloudfront.net/original/3X/8/d/8dea98d7280a299c720407260ab3a205ecddf31a.png)

Thanks in advance  
Juan

---

<div class="post-metadata">

**Author:** ![WLS-DM](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-dm/32/36109_2.png) [@WLS-DM](https://community.amazonquick.com/u/WLS-DM)\
**Post date:** [June 17, 2024, 3:27pm UTC](https://community.amazonquick.com/t/numeric-variable-in-x-axis-interpreted-as-a-category/31348/2 "2024-06-17T15:27:46Z")

</div>

Hello @Juan_Badal, welcome to the Quick Sight community!

From what I can tell, your X-Axis is referencing the groups that are available in your data. If the next highest value after 2 is 38, then it will set that as the next value on the chart. You may have better luck if you build out groups to reference on the chart instead of using the actual values to create a better representation in the visual.

If queue times go up to around 212, you could either manually check for a few different groups or build out the groups through a ranking calculation, but my thought would be something like this:

```auto
ifelse(
{queue_time} < 50, "0-50",
{queue_time} >= 50 AND {queue_time} < 100, "50-100",
{queue_time} >= 100 AND < 150, "100-150",
...etc)

```

You could do something like this so you could create even groupings within the data. Otherwise, the visual is going to reference each value available in the x-axis and scale based on the options in the data. Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![Juan\_Badal](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Juan\_Badal](https://community.amazonquick.com/u/Juan_Badal)\
**Post date:** [June 18, 2024, 10:44am UTC](https://community.amazonquick.com/t/numeric-variable-in-x-axis-interpreted-as-a-category/31348/3 "2024-06-18T10:44:30Z")

</div>

Hi @WLS-DM

It is not what I was looking for but if there is no other way this will have to do.

I am thinking I will do floor({queue\_duration} / 60) instead to group by minutes, I reckon this will make more sense for dashboard readers.

Thank you very much for your help.

Juan

---

<div class="post-metadata">

**Author:** ![WLS-DM](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-dm/32/36109_2.png) [@WLS-DM](https://community.amazonquick.com/u/WLS-DM)\
**Post date:** [June 18, 2024, 3:32pm UTC](https://community.amazonquick.com/t/numeric-variable-in-x-axis-interpreted-as-a-category/31348/4 "2024-06-18T15:32:47Z")

</div>

Hello @Juan_Badal, yes, that function should work for this situation! I know it is not the ideal solution, but this will be the best work-around for your use case. Thank you!
