Hi All,
I have requirement where I need to remove consequent duplicate value while showing the data in grid.
i,e if values are: {"Requested", "Requested", "Pending","Sent For Approval","Approved","Pending","Approved","Approved"} the expected output is {"Requested", , "Pending","Sent For Approval","Approved","Pending","Approved"}
Here "Requested" and "Approved" are getting rejected as they are consequently occurring twice.
Discussion posts and replies are publicly visible
Try this:
a!localVariables( local!list: { "Requested", "Requested", "Pending", "Sent For Approval", "Approved", "Pending", "Approved", "Approved" }, local!newList: reject( fn!isnull, a!forEach( items: local!list, expression: if( or( fv!index = 1, local!list[fv!index - 1] <> fv!item ), fv!item, null ) ) ), local!newList )
Hope it helps.