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
1 reply
Subscribers
7 subscribers
Views
3351 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I want to find both a count of and the index values of items in a cdt that are a
dylanf
over 11 years ago
I want to find both a count of and the index values of items in a cdt that are a text match of one of many values in a multi-value pv, but I'm having a hard time with this. For instance, my multi-value pv has the values of "ted" and "smith" (these will not always be the same). So, I want to first find the index values of all rows in my cdt where that cdt node equals "ted", and then "smith" I've tried combinations of the where() index() and apply() functions, but it seems like iterating through both the cdt AND the multi-value pv is what is causing me issues. Any assistance, as always, would be greatly appreciated....
OriginalPostID-77464
OriginalPostID-77464
Discussion posts and replies are publicly visible
Parents
0
Alex Weller
Appian Employee
over 11 years ago
A start is finding out all of the indices in your cdt that contain a given string (lets use ted). One way of doing this is an expression defined by: rule!stringLocationsInArray=where(apply(rule!nameEqualsName,ri!cdt.column,ri!name)) ... where rule!nameEqualsName is defined by =ri!name1=ri!name2 if this is case insensitive, use exact() if case matters.
Beyond that, it sounds like you also want to look through the second list of strings to get the indices for ted, smith, etc. Will the number of items in that second list always be the same or will it be variable? If the length is known, you can run this once for each item in the list.
Do you need to know which indices correspond to ted and which to smith? Or is a list of all indices that have either a ted or a smith sufficient? If the latter is true you can write a third expression that is defined by =apply(rule!stringLocationsInArray,ri!names,ri!array)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Alex Weller
Appian Employee
over 11 years ago
A start is finding out all of the indices in your cdt that contain a given string (lets use ted). One way of doing this is an expression defined by: rule!stringLocationsInArray=where(apply(rule!nameEqualsName,ri!cdt.column,ri!name)) ... where rule!nameEqualsName is defined by =ri!name1=ri!name2 if this is case insensitive, use exact() if case matters.
Beyond that, it sounds like you also want to look through the second list of strings to get the indices for ted, smith, etc. Will the number of items in that second list always be the same or will it be variable? If the length is known, you can run this once for each item in the list.
Do you need to know which indices correspond to ted and which to smith? Or is a list of all indices that have either a ted or a smith sufficient? If the latter is true you can write a third expression that is defined by =apply(rule!stringLocationsInArray,ri!names,ri!array)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data