How can we get 1st index elements of each array in different new array

How can we get 1st index elements of each array in different new array. Like
{2,13,65}
{7,15,45}
{14,3,56}

So output of 1st elements should be {2,7,14}
And for 2nd and 3rd {13,15,3}
{65,45,56}

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    for getting all the three arrays as desired/required

    a!localVariables(
      local!array:{
        {
          list: {2,13,65}
        },
        {
          list: {7,15,45}
        },
        {
          list: {14,3,56}
        },
        {
          list: {1,2,3}
        }
    
      },
      a!forEach(
        items:enumerate(3)+1,  /* three is the no. arrays you have to make/ output arrays */
        expression: a!localVariables(
          local!temp:fv!item,
          a!forEach(
        items: local!array,
        expression: fv!item.list[local!temp]
      )))
    )
    This 3 should not pass the minimun no. of elements(fg-3) in any any list of the array .  

Reply
  • 0
    Certified Associate Developer

    for getting all the three arrays as desired/required

    a!localVariables(
      local!array:{
        {
          list: {2,13,65}
        },
        {
          list: {7,15,45}
        },
        {
          list: {14,3,56}
        },
        {
          list: {1,2,3}
        }
    
      },
      a!forEach(
        items:enumerate(3)+1,  /* three is the no. arrays you have to make/ output arrays */
        expression: a!localVariables(
          local!temp:fv!item,
          a!forEach(
        items: local!array,
        expression: fv!item.list[local!temp]
      )))
    )
    This 3 should not pass the minimun no. of elements(fg-3) in any any list of the array .  

Children