For Each Issue

Hi ,

local!lastRowDetails: a!forEach(
items: ri!testCdt,
expression:
segment: if(and(fv!item.aId=ri!tData_cdt.id ,
fv!item.tabId=ri!tData_cdt.tName,), fv!item,{})
)

 

This is returning 7 matching rows, but i want only the data of last matched row.

 

Can you you help me in that.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    A Score Level 1
    in reply to sauravk
    Hi sauravk,

    Here is the code.Please have a look.
    load(
    local!a:{
    "A","B","C"
    },
    local!b:{
    "category1","category2","category3"
    },
    local!lastRowDetails: a!forEach(
    items: local!a,
    expression: {
    with(
    local!aitem:fv!item,
    local!index:fv!index,
    local!last:fv!isLast,
    a!forEach(
    items: local!b,
    expression: {

    if(
    and(
    fv!isLast = true(),
    local!last = true()
    ),
    local!aitem &" "&fv!item,
    {}
    )
    }
    )
    )

    }
    ),
    a!flatten(local!lastRowDetails)

    )

    Thanks,
    ravalik
Children