I have a requirement to filter negative values from readonly grid and It needs to get configured from expression rule but Im not able to filter the negative values.
I tried using "<" as operator for that particular field but still not filtering out.
please help me achieve this
Discussion posts and replies are publicly visible
Hi, please try the below code, as mike said increment that end value & check both < and >= in query filter with ri!latTo+ 1 and remove the extra query filter "between" query filter. Hope this will works for you.
a!queryFilter( field: 'recordType!{9441efd7-521a-4695-82a7-d661a237c67d}.fields.{499d2d44-21c8-41dc-a3be-2dbd3ee0356f}', operator: ">=", value: ri!latFrom, applyWhen: and( not(rule!APN_isEmpty(ri!latFrom)), rule!APN_isEmpty(ri!latTo) )),a!queryFilter( field: 'recordType!{9441efd7-521a-4695-82a7-d661a237c67d}.fields.{499d2d44-21c8-41dc-a3be-2dbd3ee0356f}', operator: "<=", value: ri!latTo + 1, applyWhen: and( not(rule!APN_isEmpty(ri!latTo)), rule!APN_isEmpty(ri!latFrom) )),
based on your screen shot, I am assuming when user is typing 42 then you need to show the values from 41 till 42.99, if so you would need to run the filter after incrementing the typed value by 1. in this case it is 43.
appian.user said:example 41.4 and 42.3 then grid should display as 41.5, 41.9, 42.2 but not 42.9
This sounds confusing to users (i.e. entering "42" would match "42.9", but entering "42.1" wouldn't match anything higher than 42.1) - however it should be possible to code. in your filter logic you could take steps to determine whether the entered value is a non-decimal value (note i'm just talking about the value, not the data type), and if so, add 1 to the value when executing the filter; otherwise, don't add anything to the value.
As far as how to check whether the entered value is a non-decimal? it's not straightforward, usually there are tricks using the various math functions. Maybe "floor(ri!num) = ceiling(ri!num)", meaning if the number rounded up to the next integer is the same as the number rounded down to the next integer, which would only be true (afaik) when the starting number is already an integer.
Thankyou so much Mike for your time and valuable information and
my issue is also resolved as the requirement wasn't decided and after all the conversation requirement came to the point that my previous solution was correct only they wanted as if user enter any non decimal value example 41 and 42 then on fields it turns out to be 41.00 and 42.00 on field and it was resolved using fixed function on text field and range should be anything between 41 and 42 like 41.4, 41.7, 41.9 but not 42.1