I am trying to compare the dates in optical query but its not working as expected. Below is my optical query
let $lastDay := '2021-01-31'
op:as("BalanceAmount", op:case((
op:when(op:eq(op:view-col("Table1", "InvoiceDate"), $lastDay), ("Table1", "BalanceAmount"))),
op:view-col("Table1", "InitialAmount")))
above query is not working as expected and when the InvoiceDate matches to $lastDay value, I am not getting correct value