Is there a way to populate the values for an array variable from 2 different arr

Is there a way to populate the values for an array variable from 2 different array variables in SAIL?
i have a array variable CDT_1 which has a ,b and c as fields and another array variable CDT_2 which has x,y and z as fields. Now I have an array variable CDT_3 which represents a CDT with fields a,b,c,x,y,z. I want to populate the CDT_3 from CDT_1 & CDT_2 in SAIL.

OriginalPostID-145331

OriginalPostID-145331

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    If you want to return an array of CDT_3 and assuming that CDT_1 and CDT_2 are of equal length, you can also do:

    apply(
              type!CDT_3(
                        a: _,
                        b: _,
                        c: _,
                        x: _,
                        y: _,
                        z: _
              ),
              merge(
                        CDT_1.a,
                        CDT_1.b,
                        CDT_1.c,
                        CDT_2.x,
                        CDT_2.y,
                        CDT_2.z
              )
    )
Reply
  • 0
    Certified Lead Developer
    If you want to return an array of CDT_3 and assuming that CDT_1 and CDT_2 are of equal length, you can also do:

    apply(
              type!CDT_3(
                        a: _,
                        b: _,
                        c: _,
                        x: _,
                        y: _,
                        z: _
              ),
              merge(
                        CDT_1.a,
                        CDT_1.b,
                        CDT_1.c,
                        CDT_2.x,
                        CDT_2.y,
                        CDT_2.z
              )
    )
Children
No Data