# How to use DENORMALIZER to achieve the following

**URL:** <https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462>\
**Category:** CloverDX Platform\
**Created:** [January 13, 2009, 12:00am UTC](https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462 "2009-01-13T00:00:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 13, 2009, 12:00am UTC](https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462/1 "2009-01-13T00:00:00Z")

</div>

How to use DENORMALIZER to achieve the following  
**source.txt**  
group2,A  
group2,B  
group2,C  
group1,A  
group1,B

**target.txt**  
group2,A,B,C  
group1,A,B,

\*\*In the 2.6 version I did not test successfully.\*\*Please give a sample to achieve

---

<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:** [January 19, 2009, 7:54am UTC](https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462/2 "2009-01-19T07:54:35Z")

</div>

```auto
//#TL
// This transformation defines the way in which multiple input records 
// (with the same key) are denormalized into one output record. 
string result;
// This function is called for each input record in a group of records with
// the same key.
function append() {
	result = concat(result, $field2,',');
}

// This function is called once after the append() function was called for all records
// in a record group defined by the key. It creates an output record for the record group.
function transform() {
	$field1 := $field1;
	$field2 := substring(result,0,length(result) - 1);
}

// Called during component initialization.
// function init() {}

// Called after the output record was created in the transform() function.
function clean() {
	result='';
}

```

---

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 19, 2009, 9:08am UTC](https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462/3 "2009-01-19T09:08:49Z")

</div>

Syntax  
**string** concat(type arg1, type arg2, …);

Thank you for your reply, concat can return string type,  
if I want to return to other types it.  
I think the data should not be passed concat to store,  
should be resolved through java.util.Map and java.util.Vector to store, but did not materialize.

source fmt

\<?xml version="1.0" encoding="utf-8"?\> 

target fmt

\<?xml version="1.0" encoding="utf-8"?\> 

**How to achieve output Record is more than the case of Field**

---

<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:** [January 19, 2009, 9:12am UTC](https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462/4 "2009-01-19T09:12:05Z")

</div>

In time being hierarchical fields are not supported by Clover.

---

<div class="post-metadata">

**Author:** ![hwhwhw](https://avatars.discourse-cdn.com/v4/letter/h/9d8465/32.png) [@hwhwhw](https://forum.cloverdx.com/u/hwhwhw)\
**Post date:** [January 22, 2009, 2:52am UTC](https://forum.cloverdx.com/t/how-to-use-denormalizer-to-achieve-the-following/462/5 "2009-01-22T02:52:24Z")

</div>

This feature can be referred to the development plan? Transpose the ranks of the basic functions is to output ports output multi-column fields. 😃
