Support Text Parameter Linkage in Fixed Time Range
Requirement: "Quick Time Range" Filter Supports Text Parameter Linkage in Fixed Time Range
To simplify the page creation process and optimize page data viewing logic, when designing dashboards, we hope that time range filters can control cards through parameter passing. For example: When selecting "Today", the line chart displays data from 0:00 today to the most recent hour; when selecting "This Week", it displays from Monday to today; when selecting "This Month", it displays from this month to today; when selecting "This Year", it displays from January to the current month.

Demo Experience
Login to experience case Demo Custom Quick Date Range.
Case Download
Download this case to local environment from Guandata Application Market Dynamic Time Macro.
Implementation Method
【Establish Global Parameters】
Take Yesterday-by hour, This Month to Yesterday-by day, This Year to Yesterday-by month as examples
Note: The field names in the parameters need to be consistent with the text of "Quick Time Range";

Create new fields in the card to process the date field accordingly. In the example, create text fields Day, Month, Yesterday, and Time Judgment
Time Judgment:
case when [DYNAMIC_PARAMS.Month Year]="This Month to Yesterday"
then
(case when [Time] between DATE_TRUNC('month',[DYNAMIC_PARAMS.Yesterday]) and CURRENT_DATE() then true else false end)
when [DYNAMIC_PARAMS.Month Year]="This Year to Yesterday" then
(case when [Time] between DATE_TRUNC('year',[DYNAMIC_PARAMS.Yesterday]) and CURRENT_DATE() then true else false end)
when [DYNAMIC_PARAMS.Month Year]="Yesterday" then
(case when cast([Time] as date)=CURRENT_DATE()-1 and hour([Time])<=hour(now()) then true else false end )
else false end
Day:
case when [Date] between DATE_TRUNC('month',[DYNAMIC_PARAMS.Yesterday]) and [DYNAMIC_PARAMS.Yesterday] then CONCAT(right([Date],2),'th') else null end
Month:
case when YEAR([Time])=YEAR(CURRENT_DATE()) and [Time]<=CURRENT_DATE() then CONCAT(MONTH([Time]),'Month') else null end
Yesterday:
case when cast([Time] as date)=CURRENT_DATE()-1 and hour([Time])<=hour(now())
then CONCAT(hour([Time]),'Hour') else null end

Configuration of new quick date range filter parameter linkage:
