# Question regarding Normalizer

**URL:** <https://forum.cloverdx.com/t/question-regarding-normalizer/2031>\
**Category:** CloverDX Platform\
**Created:** [March 14, 2019, 12:00am UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031 "2019-03-14T00:00:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.schwarz](https://avatars.discourse-cdn.com/v4/letter/p/49beb7/32.png) [@peter.schwarz](https://forum.cloverdx.com/u/peter.schwarz)\
**Post date:** [March 14, 2019, 12:00am UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031/1 "2019-03-14T00:00:00Z")

</div>

Hi there,

short Question regarding the Normalizer:

My records are like:

Week1 | Week2 | Week3  
Store1 1000 | 1300 | 900  
Store2 800 | 700 | 1100  
Store3 1400 | 1200 | 1500

And I would like to transform it like this:

Store1 | Week 1 | 1000  
Store1 | Week 2 | 1300  
Store1 | Week 3 | 900  
Store2 | Week 1 | 800  
Store2 | Week 2 | 700  
Store2 | Week 3 | 1100  
Store3 | Week 1 | 1400  
Store3 | Week 2 | 1200  
Store3 | Week 3 | 1500

I know how to get the numbers into the rows. But how can I get the labels of my records into the rows of my output?

regards  
Peter

---

<div class="post-metadata">

**Author:** ![Vladimir\_Barton](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/vladimir_barton/32/167_2.png) [@Vladimir\_Barton](https://forum.cloverdx.com/u/Vladimir_Barton)\
**Post date:** [March 19, 2019, 9:53am UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031/2 "2019-03-19T09:53:31Z")

</div>

Hi Peter,  
I have attached a sample solution to your data challenge. Worth noting are these component settings:

- FlatFileReader: Trim Strings = true (to remove redundant space characters);

- ‘input’ metadata: when extracting metadata, Extract Names = true (to get the actual metadata field names instead of generic Field[index] names);

- Reformat: using the [split()](https://doc.cloverdx.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/string-functions-ctl2.html#ctl2-split) function to parse the first field containing mixed information;

- Normalizer: using the [getFieldName()](https://doc.cloverdx.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/string-functions-ctl2.html#ctl2-getFileName) function to push the metadata field name as an output record;

Kind regards,  
Vladi

- [input.txt](https://cdn.cloverdx.com/forum/18401%5F8aa9476d000fbb1a51431fded56bb6c6/input.txt)
- [normalizer.grf](https://cdn.cloverdx.com/forum/18401%5F9c943d7bd3d1c16fc65973e42bb4af16/normalizer.grf)

---

<div class="post-metadata">

**Author:** ![peter.schwarz](https://avatars.discourse-cdn.com/v4/letter/p/49beb7/32.png) [@peter.schwarz](https://forum.cloverdx.com/u/peter.schwarz)\
**Post date:** [March 19, 2019, 5:21pm UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031/3 "2019-03-19T17:21:21Z")

</div>

Thank you Vladimir, that helps a lot!

---

<div class="post-metadata">

**Author:** ![andras.csore](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@andras.csore](https://forum.cloverdx.com/u/andras.csore)\
**Post date:** [March 19, 2019, 7:18pm UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031/4 "2019-03-19T19:18:28Z")

</div>

Hello Gents,

I like to add ‘another’ way of solution with Rollup component.  
\* in Clover is pretty usual to archive the goal in many ways.  
Vladi solution (what is just simple and perfect) also in the attached Graph, i add SimpleCopy to feed the additional Rollup component.  
Note: Rollup a little bit more complex component than Normalizer, but i think in this case may a nice introduction the Rollup also.

I also add additional input file for demo, where 5 Week exist.  
The code itself works any column amount =\> its get the field count in **length($in.0)** part. And i expect, the ‘Weeks’ start in the 2nd ‘column/field’ in the data.

Regards: Andras,  
Forum member

- [0319\_Clover\_forum\_Normalizer\_Rollup.zip](https://cdn.cloverdx.com/forum/18734%5F525fcfb52da1dba991748216175ebcd0/0319%5FClover%5Fforum%5FNormalizer%5FRollup.zip)

---

<div class="post-metadata">

**Author:** ![Vladimir\_Barton](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.cloverdx.com/vladimir_barton/32/167_2.png) [@Vladimir\_Barton](https://forum.cloverdx.com/u/Vladimir_Barton)\
**Post date:** [March 20, 2019, 9:15am UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031/5 "2019-03-20T09:15:28Z")

</div>

Hi Andras,  
thank you for the elaborated example. We really appreaciate your contribution to this topic, especially because of the complexity of using RollUp.  
Best regards,  
Vladi

---

<div class="post-metadata">

**Author:** ![andras.csore](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@andras.csore](https://forum.cloverdx.com/u/andras.csore)\
**Post date:** [March 22, 2019, 1:18pm UTC](https://forum.cloverdx.com/t/question-regarding-normalizer/2031/6 "2019-03-22T13:18:17Z")

</div>

Thanks! Actually forum cases helps me to improve my Clover skills 🙂  
Regards: Andras,
