# Table column Sort with nulls, change to space?

**URL:** <https://forum.servoy.com/t/table-column-sort-with-nulls-change-to-space/20015>\
**Category:** Classic Servoy\
**Created:** [June 24, 2019, 2:14pm UTC](https://forum.servoy.com/t/table-column-sort-with-nulls-change-to-space/20015 "2019-06-24T14:14:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe26](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@joe26](https://forum.servoy.com/u/joe26)\
**Post date:** [June 24, 2019, 2:14pm UTC](https://forum.servoy.com/t/table-column-sort-with-nulls-change-to-space/20015/1 "2019-06-24T14:14:49Z")

</div>

Hi,

Is there a way within Query Builder to perform an operation on columns that results in the display of spaces?

When a column is resorted by selection, all null items appear at the top of the sort. In the case of nulls, those null values sort first.  
Real data always shows at the bottom of the table. Can calculations be used?

Has anyone seen and resolved this issue?

thanks,  
–Joe.

---

<div class="post-metadata">

**Author:** ![rgansevles](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rgansevles](https://forum.servoy.com/u/rgansevles)\
**Post date:** [July 5, 2019, 7:25am UTC](https://forum.servoy.com/t/table-column-sort-with-nulls-change-to-space/20015/2 "2019-07-05T07:25:17Z")

</div>

Joe,

This may be achieved by changing the collation on your database.

You cannot use calculations in QueryBuilder.

In QueryBuilder, you could sort on values using the nullif function:

```auto
query.sort.add(query.columns.mycol.nullif('').asc)

```

Hope this helps,

Rob
