Skip to main content

Display Date on Cards to Remind Business Data Timeliness

Requirement Description

Scenario 1

Display data update time at the beginning of the entire page to understand the current data cutoff date;

Real-time page:

image.png

Page subscription or export PDF, the file needs to have date and time

image.png

Scenario 2

In bar-line charts, the coordinate axis displays dates, and only displays days. The card needs to prompt users which month's data the card is showing or other information;

image.png

Scenario 3

In analysis, business needs to perform arbitrary time filtering, but some content is fixed period. Take the figure below as an example. Time filtering looks at the last 7 days, one indicator looks at interval cumulative value, one looks at MTD, one looks at yesterday, and the date needs to be displayed on the card for business reference;

image.png

Demo Experience

Login to experience case Demo Display Dynamic Date in Card Title.

Case Download

Download this case to local environment from Guandata Application Market Dynamic Time Macro.

Requirement Implementation

From the implementation perspective, there are two implementation methods.

Solution One

Through text cards referencing card data, creating indicator cards/comparison indicator cards to implement, the specific implementation method is as follows:

Step1: Create a new text card, and click Reference Card Data in the edit;

image.png

Step2: Click "Add", then drag the date field into the numerical area of the indicator card as needed;

image.png

Step3: Change the field aggregation method to: Maximum or Minimum, to display as date format

image.png

After selecting aggregation method as Maximum or Minimum, there's only one corresponding value;

· When the page has a date filter, after linkage the date is unique and will change with the filter;

· When the page has no filter, you can drag the date field to the card's filter and adjust the date that needs to be displayed;

You can also directly create an indicator card or comparison indicator card to display dates, the steps are the same as creating cards, the key step is also in Step3;

image.png

Solution Two

For cards that can create summary indicators and need to display dates, the specific implementation steps are as follows:

Take clustered chart as an example:

Step1: Create a clustered chart card, drag in the relevant required fields;

image.png

Step2: Click the summary indicator, select the calculated metric indicator as date, modify the aggregation method to maximum or minimum

image.png

Brief Description of Implementation Methods for the Above Three Scenarios

Scenario 1: Can be solved using Solution One;

Scenario 2: Can be solved using Solution Two;

Scenario 3: Use Solution One to solve, but also need to combine date filtering and creating new fields. The following explains through screenshots:

image.png

KPI Cumulative Period:

· Start date, aggregation method select minimum value;

· End date, aggregation method select maximum value;

KPI MTD Period:

· First day of the month, can be achieved by creating a new field using the function trunc([Date], 'MM'), aggregation method select no processing.

· End date, aggregation method select maximum value;

Yesterday:

· Date, aggregation method select maximum value, and don't link with the date filter

Or solve through the card's date filter, write time macro;

image.png