Multi filtered query pin a value for all records in single column


FROM dataset


[[AND LOWER(store) LIKE CONCAT('%',LOWER({{store}}),'%')]]

[[AND CAST({{pending_lower_limit}} AS TIME) <= pending_time]]

[[AND CAST({{picking_lower_limit}} AS TIME) <= picking_time]]

[[AND CAST({{ready_lower_limit}} AS TIME) <= ready_time]]

[[AND CAST({{on_trip_lower_limit}} AS TIME) <= on_trip_time]]

[[AND CAST({{delivery_lower_limit}} AS TIME) <= delivery_time]]

[[AND CAST({{overall_lower_limit}} AS TIME) <= overall_time]]

When I run the above query the first two filters and the last filter works perfectly fine, However, all other filter have the same proplem; They DO filter with the records satisfying the condition but they show a wrong value that is then fixed for the whole column I am filtering on.

Any body faced similar problem or have any idea if there is anything wrong in my query?

Hi @omar.omran
Have a look at Debugging SQL syntax errors, and then try using hardcoded values instead of variables to see if it is something unrelated to variables (meaning just something wrong in the query or the data).