Overview
You may need to display the current time or the number of days to go until a countdown date.
Preview
Example 1:
Display the number of days to go until 2023/12/31 on the dashboard, as shown in the following figure.
Example 2:
Display the current time on the dashboard, as shown in the following figure.
Implementation Method
Example 1: Use the TODATE function to specify a countdown date, add a time interval column to calculate the number of days to go until the countdown date, and convert the Field Type to Text. Create a KPI card component to display the result.
Example 2: Use the NOW function to get the current time and create a KPI card component to display the result.
Example 1
Creating an Analysis Subject
Create an analysis subject and upload the built-in table BIdemo_Sales Details.
Specifying the Countdown Date
Click Formula Column and name the added column as Countdown Date. Enter the formula TODATE("2023-12-31") and click OK.
Calculating the Countdown Days
Choose More > Time Interval and name the added column as Countdown Days. Set Time Interval to Countdown Date - Current time, Unit to Day(s), and click OK.
Converting Field Type to Text
Since the Countdown Days field is value-type data, simply using this field for the KPI card component returns the accumulated value of all data rows. So you need to convert the Field Type of Countdown Days to Text.
Rename the field as Countdown Days (Text-type) and click Save All and Update.
Creating a KPI Card
Create a component, click KPI Indicator Card, and drag the Countdown Days (Text-type) field into Graphic Property > Text. To edit the content format, you can choose >
and customize the format.
Demonstration
On PC
For the demonstration of this KPI card, see the first figure in section "Preview".
On Mobile Terminal
Example 2
Calculating the Current Time
Add Formula Column and name the added column as Current Time. Enter the formula Now() and click OK.
Creating a KPI Card
Create a component, click KPI Indicator Card, and drag the Current Time field into Graphic Property > Text. To edit the content format, you can choose >
and customize the format.
If the Current Time field is of the time type, you need to set the group way to Year-Month-Day-Hour-Minute-Second.
Demonstration
On PC
For the demonstration of this KPI card, see the second figure in section "Preview".
On Mobile Terminal