Hi,
"I have three lists and I need to obtain the values present in all three lists? How can I do this without having to perform an inner join on the database?"
ex. list1: {"IT","UK,"DZ", "USA"}
list2: {"DZ", "USA"}
list3: {"IT","UK,"DZ"}
and I need to obtain {"DZ"}
thanksss
Discussion posts and replies are publicly visible
This code may help you
a!localVariables( local!list1: {"IT", "UK", "DZ", "USA"}, local!list2: {"DZ", "USA"}, local!list3: {"IT", "UK", "DZ"},
a!forEach( items: local!list1, expression: if( and(contains(local!list2, fv!item), contains(local!list3, fv!item)), fv!item, {} ) ))
Do you need/want to solve this in the database?
Do you want to do this for VIEW definition in database?
DO it in the database, merge the list in SAIL or use records.....
hi cugino95 instead of doing that in database it will be easy to do it in appian side using intersection() this function will help you click on the link for more details of that function
By writing a query first get that three lists to Appian environment from Database then write this expression,
intersection(local!list1,local!list2,local!list3))
list1: {"IT", "UK", "DZ", "USA"},list2: {"DZ", "USA"},list3: {"IT", "UK", "DZ"}
commonValues = intersection(list1, list2, list3);
---> commonValues' will contain {"DZ"} as it is the common element
Hi cugino95 ,
The below code might help you
a!localVariables( local!list1: {"IT", "UK", "DZ", "USA"}, local!list2: {"DZ", "USA"}, local!list3: {"IT", "UK", "DZ"}, local!intersection1:intersection(local!list1,local!list2), local!intersection2:intersection(local!intersection1,local!list3), local!intersection2 )