Forum Discussion
ODATA with Or operator
- 1 year ago
Hi nok , Thank you for reaching out to the Microsoft Community Forum.
The problem likely stems from an API-specific behaviour or limitation in handling complex or conditions.
Please try below:
let
BaseUrl = "https://api.xyz.com/MyTable",
RDateQuery = OData.Feed(BaseUrl & "?$filter=RDate ne null and RDate gt 2024-01-01T00:00:00Z", null, [Implementation="2.0", Timeout=#duration(0, 1, 30, 0)]),
PODateQuery = OData.Feed(BaseUrl & "?$filter=PODate ne null and PODate gt 2024-01-01T00:00:00Z", null, [Implementation="2.0", Timeout=#duration(0, 1, 30, 0)]),
RXDateQuery = OData.Feed(BaseUrl & "?$filter=RXDate ne null and RXDate gt 2024-01-01T00:00:00Z", null, [Implementation="2.0", Timeout=#duration(0, 1, 30, 0)]),
Combined = Table.Combine({RDateQuery, PODateQuery, RXDateQuery}),
Result = Table.Distinct(Combined)
in
Result
some twerks may be needed.If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi nok , Thank you for reaching out to the Microsoft Community Forum.
The problem likely stems from an API-specific behaviour or limitation in handling complex or conditions.
Please try below:
let
BaseUrl = "https://api.xyz.com/MyTable",
RDateQuery = OData.Feed(BaseUrl & "?$filter=RDate ne null and RDate gt 2024-01-01T00:00:00Z", null, [Implementation="2.0", Timeout=#duration(0, 1, 30, 0)]),
PODateQuery = OData.Feed(BaseUrl & "?$filter=PODate ne null and PODate gt 2024-01-01T00:00:00Z", null, [Implementation="2.0", Timeout=#duration(0, 1, 30, 0)]),
RXDateQuery = OData.Feed(BaseUrl & "?$filter=RXDate ne null and RXDate gt 2024-01-01T00:00:00Z", null, [Implementation="2.0", Timeout=#duration(0, 1, 30, 0)]),
Combined = Table.Combine({RDateQuery, PODateQuery, RXDateQuery}),
Result = Table.Distinct(Combined)
in
Result
some twerks may be needed.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Thanks, v-hashadapu
The code worked perfectly this way! It seems that it really is some kind of ODATA limitation.