Customer Portal

How to use DENORMALIZER to achieve the following

Comments 4

  • Avatar
    avackova
    0
    Comment actions Permalink
    //#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='';
    }
  • Avatar
    hwhwhw
    0
    Comment actions Permalink
    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"?>
    <Record name="" type="delimited">
    <Field name="Field0" type="string" format="" nullable="true" default="0" size="100" length="100" scale="0" delimiter=","/>
    <Field name="Field1" type="string" format="" nullable="true" default="0" size="100" length="100" scale="0" delimiter="\n"/>
    </Record>


    target fmt
    <?xml version="1.0" encoding="utf-8"?>
    <Record name="" type="delimited">
    <Field name="Field00" type="string" format="" nullable="true" default="0" size="100" length="100" scale="0" delimiter=","/>
    <Field name="Field11" type="string" format="" nullable="true" default="0" size="100" length="100" scale="0" delimiter=","/>
    <Field name="Field22" type="string" format="" nullable="true" default="0" size="100" length="100" scale="0" delimiter=","/>
    <Field name="Field33" type="string" format="" nullable="true" default="0" size="100" length="100" scale="0" delimiter="\n"/>
    </Record>

    How to achieve output Record is more than the case of Field
  • Avatar
    avackova
    0
    Comment actions Permalink
    In time being hierarchical fields are not supported by Clover.
  • Avatar
    hwhwhw
    0
    Comment actions Permalink
    This feature can be referred to the development plan? Transpose the ranks of the basic functions is to output ports output multi-column fields. :D

Please sign in to leave a comment.