local!data: { { name: "John", status: "Active", test: 10 }, { name: "John", status: null, test: 4 }, { name: "Alice", status: "Active", test: 5 }, { name: "Alice", status: null, test: 6 }, { name: "Bob", status: null, test: 8 } }
Discussion posts and replies are publicly visible
hi,
So you want to remove the duplicate null with null status right. Hope the code will help
a!localVariables( local!data: { { name: "John", status: "Active", test: 10 }, { name: "John", status: null, test: 4 }, { name: "Kiran",status: null, test: 10}, { name: "Kiran",status: "Active", test: 10}, { name: "Alice", status: "Active", test: 5 }, { name: "Alice", status: null, test: 6 }, { name: "Bob", status: null, test: 8 } }, local!uniqueNames:union(index(local!data,"name",null),index(local!data,"name",null)), local!DuplicateUsers:reject(fn!isnull,a!forEach( items: local!uniqueNames, expression: if( count(wherecontains(touniformstring(fv!item),touniformstring(index(local!data,"name",null))))>1, fv!item, null() ) )), local!duplicateUserIndexes:index(local!data,wherecontains( touniformstring(local!DuplicateUsers), touniformstring(index(local!data,"name",null)) ),null), reject(fn!isnull,a!forEach( items: local!duplicateUserIndexes, expression: if( touniformstring(index(fv!item,"status",null))=touniformstring(null), null, fv!item ) )) )