# How to Trim values in the graph

**URL:** <https://forum.cloverdx.com/t/how-to-trim-values-in-the-graph/303>\
**Category:** CloverDX Platform\
**Created:** [April 10, 2008, 12:00am UTC](https://forum.cloverdx.com/t/how-to-trim-values-in-the-graph/303 "2008-04-10T00:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shantanu](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@shantanu](https://forum.cloverdx.com/u/shantanu)\
**Post date:** [April 10, 2008, 12:00am UTC](https://forum.cloverdx.com/t/how-to-trim-values-in-the-graph/303/1 "2008-04-10T00:00:00Z")

</div>

Does anyone have example of how to use Trim function in Reformat graph.  
i.e  
I am trying to read from database and write to a flatfile. Let’s say there is only one field “Name”, which as trailing space. How can I use trim fucntion to remove all spaces before writing in the flat file.

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [April 10, 2008, 7:12am UTC](https://forum.cloverdx.com/t/how-to-trim-values-in-the-graph/303/2 "2008-04-10T07:12:02Z")

</div>

```auto
function transform(){
$Name:=trim($Name);
}

```

or

```auto
function transform(){
$Name:=iif(isnull($Name),null,trim($Name));
}

```
