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
7 replies
Subscribers
7 subscribers
Views
3897 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
How do get back only unique results from a query rule? For example, I'm usi
Chasity Davis
over 10 years ago
How do get back only unique results from a query rule? For example, I'm using a query rule to return back a list of all types of products ordered today. So I query the ORDER table for today's orders, and want to display only the product types. getOrdersByDate(today(),date!pagingInfo) Lets say this query rule returns the following results: Widget, Toy, Shoe, Toy, Widget
How do I get it to only return: Widget, Toy, Shoe...
OriginalPostID-97362
OriginalPostID-97362
Discussion posts and replies are publicly visible
0
Christine
Appian Employee
over 10 years ago
Using a union function will remove the duplicates.
forum.appian.com/.../Set_Functions
Hope that helps
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 10 years ago
I did see the union function, however I'm only using 1 array of data. My understanding of union is that it compares 2 or more arrays of data.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Christine
Appian Employee
over 10 years ago
You are correct. So I would recommend comparing the array you have against itself. It will remove the duplicates. Thanks!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 10 years ago
Works like a charm we use it all of the time.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 10 years ago
Thank you! I'll try it out.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chasity Davis
over 10 years ago
Well, it doens't appear to be working within my paging grid. I'm doing the following and nothing appears. However when I remember the union I get results, but with my duplicates. Thoughs?
=union(rule!SO_CA_GetHoldingsBySecurityByCADetailsID(pv!caEventDetails.caDetailsId,data!pagingInfo),rule!SO_CA_GetHoldingsBySecurityByCADetailsID(pv!caEventDetails.caDetailsId,data!pagingInfo))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
helmuta
over 10 years ago
We always run them separately in two statements like:
Union(abc,abc) stored into !pv
display !pv
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel