Suppose you have an attribute that is an enumeration and multi-valued choices are permitted. What is the DXL syntax to use the query criteria "is empty" (no enumerations are chosen)? What is the DXL syntax to use the query criteria "is not empty" (one or more enumerations are chosen)?
Fu Lin Yiu - Fri Jan 31 14:00:11 EST 2014 |
Re: DXL Filter Syntax for "is empty", "is not empty" Filter f1 = isNull attribute "test" Filter f2 = notNull attribute "test" Did you try these? Regards, Mathias |
Re: DXL Filter Syntax for "is empty", "is not empty" Mathias Mamsch - Sun Feb 02 05:40:14 EST 2014 Filter f1 = isNull attribute "test" Filter f2 = notNull attribute "test" Did you try these? Regards, Mathias I tried notNull(attribute("MyAttribute)) and it worked as "is not empty". I'm assuming its counterpart isNull(attribute("MyAttribute)) will correspond to "is empty" but I did not have a chance to test. It would be more intuitive if they were named isNotEmpty(attribute("MyAttribute)) and isEmpty(attribute("MyAttribute)) to match the GUI nomenclature, but at least it works. I'll take it. Thanks.
|
Re: DXL Filter Syntax for "is empty", "is not empty" Fu Lin Yiu - Wed Feb 05 18:43:15 EST 2014 I tried notNull(attribute("MyAttribute)) and it worked as "is not empty". I'm assuming its counterpart isNull(attribute("MyAttribute)) will correspond to "is empty" but I did not have a chance to test. It would be more intuitive if they were named isNotEmpty(attribute("MyAttribute)) and isEmpty(attribute("MyAttribute)) to match the GUI nomenclature, but at least it works. I'll take it. Thanks.
You are right. I would have guessed, that isNull would filter "null" values = default values and therefore should mean "hasDefault". A quick test reveals that it really means "empty", i.e. if you have a default value, this value will not be taken into account. Therefore "isEmpty" would really be a much better name. Regards, Mathias |