Hi, I have a problem related to the complex default filter for the date range.
I'm using a single date for 2 separate filters {{Start date}} and {{End date}} and I hope it'll work as field filter {{date range}}. My query below:
where 1=1 [[and {{CreatedAt}}]] [[and {{OrgId}}]] [[and {{SubCompanyId}}]] [[and {{ProposerId}}]] [[and {{departmentId}}]]
[[and {{ProposerName}}]] [[and {{departmentname}}]] [[and {{SelectedUserName}}]] [[and {{SelectedUserId}}]] [[and {{Flowtitle}}]]
AND "public"."smart_formmodel"."CreatedAt" >= coalesce([[{{Startdate}}::date,]] DATE_TRUNC('month', current_date)) AND
"public"."smart_formmodel"."CreatedAt" <= coalesce([[{{EndDate}}::date,]] current_date )
It works fine in almost every case but doesn't work for pivot tables that can't use native SQL.
So, I'm trying to use field filter {{date_range}} instead of 2 single date filters like now. But I don't know how to set it as This month when nothing is chosen, it looks more complex than using 2 separate filters.
Does anybody have any idea about this case? Please let me know. Thanks in advance.