Array Functions

Hi All,

I have a requirement where there is a count eg. 12 containing {1,2,3,4,5,6,7,8,9,10,11,12} , from which i need to take out 3 lists like listA: {1,4,7,10}, listB: {2,5,8,11} and listC: {3,6,9,12} with uniform interval of 4. How can I achieve this in looping . You suggestion is appreciated.. Thanks

OriginalPostID-254666

  Discussion posts and replies are publicly visible

Parents
  • Here's one solution:

    with(

    local!arrayLength: length(ri!array),

    local!listA: wherecontains(todecimal(0), mod(3+enumerate(local!arrayLength), ri!interval )) ,

    local!listB: wherecontains(todecimal(0), mod(2+enumerate(local!arrayLength), ri!interval)) ,

    local!listC: wherecontains(todecimal(0), mod(1+enumerate(local!arrayLength), ri!interval )),

    {

    local!listA,
    local!listB,
    local!listC
    }
    )
Reply
  • Here's one solution:

    with(

    local!arrayLength: length(ri!array),

    local!listA: wherecontains(todecimal(0), mod(3+enumerate(local!arrayLength), ri!interval )) ,

    local!listB: wherecontains(todecimal(0), mod(2+enumerate(local!arrayLength), ri!interval)) ,

    local!listC: wherecontains(todecimal(0), mod(1+enumerate(local!arrayLength), ri!interval )),

    {

    local!listA,
    local!listB,
    local!listC
    }
    )
Children
No Data