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
1014 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
In Appian 7.3 i'm using 'logicalExpression|filter|search' and facing
skumar
over 10 years ago
In Appian 7.3 i'm using 'logicalExpression|filter|search' and facing problem while trying to filter my data on two columns using AND operator as mentioned in wiki. How can i use QueryFilter with AND condition & achieve this. Can anyone please help me with syntax ? My sample code is given below for reference.
'logicalExpression|filter|search': if(
local!month=1,
'type!{
www.appian.com/.../2009}QueryFilter'(field:
"year", operator: "=", value: if(local!year=1,2013,if(local!year=2,2012,if(local!year=3,2011,"")))),
AND('type!{
www.appian.com/.../2009}QueryFilter'(field:
"year", operator: "=", value: if(local!year=1,2013,if(local!year=2,2012,if(local!year=3,2011,"")))),'type!{
www.appian.com/.../2009}QueryFilter'(field:
"month", operator: "=", value: local!month)
)
Many thanks in advance....
OriginalPostID-89362
OriginalPostID-89362
Discussion posts and replies are publicly visible
Parents
0
sikhivahans
over 10 years ago
Hi skumar, LogicalExpression is the component which encapsulates the query filters either with "AND" or "OR" operator.
type!LogicalExpression(
operator:"AND",
'logicalExpression|filter|search': {
type!QueryFilter(
field:"year",
operator:"=",
value:if(local!year=1,2013,if(local!year=2,2012,if(local!year=3,2011,"")))
),
type!QueryFilter(
field:"month",
operator:"=",
value:local!month
)
}
)
But my suggestion is to proceed with the usage of Appian Common Objects which will make your code look clean and easily understandable
Ex:
rule!APN_logicalExpression
(
"AND",
{
rule!APN_queryFilter("year","=",if(local!year=1,2013,if(local!year=2,2012,if(local!year=3,2011,"")))),
rule!APN_queryFilter("month","=",local!month)
}
)
Let me know if you have any follow-up questions
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sikhivahans
over 10 years ago
Hi skumar, LogicalExpression is the component which encapsulates the query filters either with "AND" or "OR" operator.
type!LogicalExpression(
operator:"AND",
'logicalExpression|filter|search': {
type!QueryFilter(
field:"year",
operator:"=",
value:if(local!year=1,2013,if(local!year=2,2012,if(local!year=3,2011,"")))
),
type!QueryFilter(
field:"month",
operator:"=",
value:local!month
)
}
)
But my suggestion is to proceed with the usage of Appian Common Objects which will make your code look clean and easily understandable
Ex:
rule!APN_logicalExpression
(
"AND",
{
rule!APN_queryFilter("year","=",if(local!year=1,2013,if(local!year=2,2012,if(local!year=3,2011,"")))),
rule!APN_queryFilter("month","=",local!month)
}
)
Let me know if you have any follow-up questions
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data