Solved

Query Date Field for Headline insight

  • 25 February 2022
  • 6 replies
  • 62 views

HI All,

I would like to show a date as a headline component. Is this possible?

I am using GDCN 1.6

 

E.g. from my dataset, I want to show what is the `select max(date)`

icon

Best answer by Joseph Heun 25 February 2022, 20:24

View original

6 replies

Userlevel 3

The metric to display a MAX date would like something like the following based on your LDM and connection point: 

Select MAX (SELECT DATE (date) By Connection Point

Hi Joseph,

Could you clarify your answer please?

To illustrate this use case -- the LDM is 1 table only. And it has a date field “start_time” --

How can write a metric to return max(start_time) across the dataset?

Thank you

Userlevel 3

Hi Carson,

I may have misspoke as it works differently with dates in headline reports. You may need to try something like the following: 

 

```
SELECT MAX ((SELECT (10000 * MAX( Year Snapshot))) + (100 * MAX(Month (Snapshot))) + (MAX(Day of Month (Snapshot))) BY Connection point)) WHERE (SELECT COUNT(Date (Snapshot), Connection point) BY Year (Snapshot), ALL OTHER) > 0
```

The final step will be apply the following number formatting:

```
[=null]N/A;
####-##-##
```

 

However, you say that you are looking for a max(start_time) is this for an attribute time dimension rather than a date dimension? 

Hi Joseph,

This “start_time” field is a date dimension.

This is a single-table example, so there is no connection point.

Hi Joseph Heun, do you have any update on this question? Thanks

Userlevel 3

Hi Carson,

 

It seems really strange that you would only be working with a single date dimension within your workspace. How exactly are you planning on analyzing only dates in your workspace? Could you post a screenshot of your LDM here?

Reply