openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

NOT operator for sap.ui.model.Filter

Open rpbouman opened this issue 8 years ago • 16 comments

OpenUI5 version: any

Browser/version (+device/version): NA

Any other tested browsers/devices(OK/FAIL): NA

URL (minimal example if possible): https://answers.sap.com/questions/214856/how-to-build-sap-ui5-filters-with-not.html

User/password (if required and possible - do not post any confidential information here): NA

Steps to reproduce the problem:

  1. Build a filter
  2. Wonder how to negate it (OData equivalent of "not")
  3. Fail.

What is the expected result? I would like to have a "not" flag on my filter. Setting the flag should produce the OData equivalent of "$filter=not(...filter...)"

What happens instead? Head meets desk. How can this feature be missing?

Any other information? (attach screenshot if possible)

rpbouman avatar Jun 04 '17 06:06 rpbouman

Hello @rpbouman , I've created a internal incident 1780185946 regarding your question. You can check its status on GitHub. Regards, Diana

Shtilianova avatar Jun 09 '17 13:06 Shtilianova

Cheers @Shtilianova , much obliged!

rpbouman avatar Jun 09 '17 13:06 rpbouman

Hello @rpbouman,

yes, we are aware of this, there exists a backlog item for a long time, I have updated it with your information.

Regards, Malte

goligo avatar Feb 01 '18 16:02 goligo

Thanks goligo. Anything I can do to make this go faster? Does the team accept pull requests?

rpbouman avatar Feb 01 '18 16:02 rpbouman

Hi rpbouman, Is this a enhancement in Filter or the request is still open? Meantime, Is there any work around for the issue?

Regards Karthik S

karthikspandian avatar Apr 13 '18 14:04 karthikspandian

@karthikspandian well, the latest API docs do not contain proof that the feature is supported yet. So I'm going to say: yes it's still open.

Is there any work being done? - well you'd have to ask SAP I guess. I asked in this thread if the team accepts pull requests, and that remained unsanswered.

rpbouman avatar Apr 13 '18 14:04 rpbouman

I guess this feature will be available as of 1.58 according to https://github.com/SAP/openui5/commit/c2d7bb919da2c64e1ce45e5083dcddaf5796e54a.

boghyon avatar Jul 18 '18 07:07 boghyon

Hi,

the commit looks like it will expand the set of some existing operators with negated versions of those operators. These would all be about scalar operators.

My request was for a filter that negates an arbitrary filter in its entirety, in particular, if there is a list of filters combined with the and flag - I need something like that, but to negate them. The equivalent OData filter expression would be:

$filter=<some arbitrary, possibly composite condition>

with the negated filter applied:

$filter=not( <some arbitrary, possiblly composite condition> )

So, please don't close this issue. It will not be resolved by the linked commit.

On Wed, Jul 18, 2018 at 9:07 AM Boghyon Hoffmann [email protected] wrote:

I guess this feature will be available as of 1.58 according to c2d7bb9 https://github.com/SAP/openui5/commit/c2d7bb919da2c64e1ce45e5083dcddaf5796e54a .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SAP/openui5/issues/1512#issuecomment-405831855, or mute the thread https://github.com/notifications/unsubscribe-auth/AAngk5-2BXzsGmcSX5XvgLNvr79lkaEKks5uHt6vgaJpZM4NvS2p .

-- Roland Bouman blog: http://rpbouman.blogspot.com/ twitter: @rolandbouman linkedin: http://www.linkedin.com/profile/view?id=5142800&trk=tab_pro

rpbouman avatar Jul 18 '18 07:07 rpbouman

I’m not sure why no one is answering your pull request question, but pull requests are accepted. However, perhaps more often for basic bug fixes than for entirely new features. Would be nice if someone from the team weighed in.

esjewett avatar Sep 16 '18 12:09 esjewett

Hi @rpbouman Is there any news on this?

hannaol avatar Jan 10 '22 10:01 hannaol

@rpbouman as @boghyon already wrote. We've introduced negated filter operators. From our point of view this satisfies your requirement. If you are aware of any scenarios not supported by them, feel free to post them here and we'll reopen this issue. And sorry for answering so late.

flovogt avatar Mar 31 '22 08:03 flovogt

@flovogt I believe the scenario that brought me to this issue, is not supported by the solution provided. For ODatav4 there is the possibility of lambda filters over navigation properties. My requirements were to filter an entity for:

  1. the navigation property entity is not empty : /entity?$filter=NP/any()
  2. it is empty : /entity?$filter=not NP/any() As far as I know negating lambda filters is not supported. Please let me know if i'm mistaken.

(I have worked around this by using the"changeParameters()" function on the binding)

hannaol avatar Mar 31 '22 08:03 hannaol

Thanks @hannaol for providing this scenario. I'll reopen the issue and the responsible team will discuss this requirement.

flovogt avatar Apr 01 '22 06:04 flovogt

Hello all! Do we have any updates on this issue? We are having the same difficulty negating Lambda functions.

matheusbrasil avatar Jul 20 '23 10:07 matheusbrasil

Hi @matheusbrasil,

unfortunately not.

Best regards Mathias.

uhlmannm avatar Jul 20 '23 11:07 uhlmannm

7 years after ticket creation. And it's still not there. So sad.

harelyshau avatar May 02 '24 16:05 harelyshau