Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
9 replies
Subscribers
7 subscribers
Views
1811 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Can any one help on this I need a function or a logic which gives expected outpu
RAAS INFOTEK LLC
over 8 years ago
Can any one help on this I need a function or a logic which gives expected output from two arrays.
each variable from array1 should map with all variables in array2.
{a,b} {c,d,e} output (a,c)(a,d)(a,e)(b,c)(b,d)(b,e)
{a} {b,c,d} output (a,b)(a,c)(a,d)
Thanks
OriginalPostID-210308
OriginalPostID-210308
Discussion posts and replies are publicly visible
Parents
0
Stefan Helzle
A Score Level 3
over 8 years ago
OK. Lets try this. I had to add another helper expression. This returns a true list of value pairs. I hope this is what you want.
BuildValuePair(value1(any), value2(any)):
={ri!value1, ri!value2}
HelperEx(map(any), list(any), value(any)):
=append(ri!map, apply(
rule!BuildValuePair(
value1:_,
value2:_
),
merge(
repeat(length(ri!list), ri!value),
ri!list
)
))
Call:
reduce(
rule!TS_TestExpression(
map:_,
value: _,
list: {"c", "d", "e"}
),
{},
{"a", "b"}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Stefan Helzle
A Score Level 3
over 8 years ago
OK. Lets try this. I had to add another helper expression. This returns a true list of value pairs. I hope this is what you want.
BuildValuePair(value1(any), value2(any)):
={ri!value1, ri!value2}
HelperEx(map(any), list(any), value(any)):
=append(ri!map, apply(
rule!BuildValuePair(
value1:_,
value2:_
),
merge(
repeat(length(ri!list), ri!value),
ri!list
)
))
Call:
reduce(
rule!TS_TestExpression(
map:_,
value: _,
list: {"c", "d", "e"}
),
{},
{"a", "b"}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data