# Combine columns and convert to a single target value

**URL:** <https://forum.cloverdx.com/t/combine-columns-and-convert-to-a-single-target-value/1526>\
**Category:** CloverDX Platform\
**Created:** [November 17, 2014, 12:00am UTC](https://forum.cloverdx.com/t/combine-columns-and-convert-to-a-single-target-value/1526 "2014-11-17T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterpan](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@peterpan](https://forum.cloverdx.com/u/peterpan)\
**Post date:** [November 17, 2014, 12:00am UTC](https://forum.cloverdx.com/t/combine-columns-and-convert-to-a-single-target-value/1526/1 "2014-11-17T00:00:00Z")

</div>

hey guys,

i need your help because i didn’t find any hints in the documentation.  
my issue: i have a target table, where i want to write a concatenated string. the concatenated string should be the result of two columns (e.g. name and version). so i define a spreadsheet reader and define the metadata as follow (name: string, version: string).

afterwards i connect it with a transformer. the code of the transformer (reformat) is:

```auto

//#CTL2

function integer transform() {

$out.0.Anwendung=concat($in.0.Anwendung,$in.0.Version);

	return ALL;
}

```

but it seems not to work this way:

my result is always:

name + null

have anybody an idea how make it work?

best regards

---

<div class="post-metadata">

**Author:** ![imriskal](https://avatars.discourse-cdn.com/v4/letter/i/b38774/32.png) [@imriskal](https://forum.cloverdx.com/u/imriskal)\
**Post date:** [November 18, 2014, 10:04am UTC](https://forum.cloverdx.com/t/combine-columns-and-convert-to-a-single-target-value/1526/2 "2014-11-18T10:04:42Z")

</div>

Hi,

concat function returns null as a part of the output string. If you want to avoid it, use something like this:

```auto
//#CTL2

function integer transform() {

	if (isnull($in.0.Version)){
		$out.0.Anwendung=$in.0.Anwendung;
	} else {
		$out.0.Anwendung=concat($in.0.Anwendung,$in.0.Version);
	}	
	
	return ALL;
}

```

---

<div class="post-metadata">

**Author:** ![peterpan](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@peterpan](https://forum.cloverdx.com/u/peterpan)\
**Post date:** [November 18, 2014, 4:34pm UTC](https://forum.cloverdx.com/t/combine-columns-and-convert-to-a-single-target-value/1526/3 "2014-11-18T16:34:24Z")

</div>

Hi,

i think you misunderstood me. I don’t want to avoid this valuecombination. Furthermore i don’t understand why the second value is NULL although the metadata is defined from the source-excelsheet.

Best Regards
