In Appian 7.3 i'm using 'logicalExpression|filter|search' and facing

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
  • 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
Reply
  • 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
Children
No Data