Forum Discussion

nok's avatar
nok
Advocate II
1 year ago
Solved

ODATA with Or operator

Hello! I'm trying to create a filter in my dataflow (that connects to an ODATA) that searches for all rows where the date columns RDate or PODate or RXDate are greater than 01/01/2024. However, ther...
  • v-hashadapu's avatar
    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.