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
3 replies
Subscribers
9 subscribers
Views
3451 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi All, I would like to get the count of common items in an integer a
aswinb
over 10 years ago
Hi All,
I would like to get the count of common items in an integer array. For instance if an array has the following values say loca!array: {1,1,1,1,1,1, 2,2,2,2} then I need a local!length array that has the following value local!length:{6,4} which indicates that there are 6 1's and 4 2's. I did a union of the local!array to itself and got the individual items inside the array but don't know how to proceed further to get the count. any help would be deeply appreciated!...
OriginalPostID-131936
OriginalPostID-131936
Discussion posts and replies are publicly visible
0
sonalk
over 10 years ago
Try this :
with(
local!array: {1,1,1,1,1,1, 2,2,2,2} ,
local!countArray : {length(wherecontains(1,local!array)),length(wherecontains(2,local!array))},
local!countArray
)
Output will be : 6,4
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aswinb
over 10 years ago
the value 1 and 2 are dynamic...it keeps changing and so I can't supply it directly inside where contains.....
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chris
over 10 years ago
You are looking for:
=apply(fn!length,merge(apply(fn!wherecontains,union(local!array,local!array),local!array)))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel