Solved

Query Date Field for Headline insight

  • 25 February 2022
  • 6 replies
  • 49 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 2

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?

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

Hi Joseph,

This “start_time” field is a date dimension.

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

Userlevel 2

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,

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 2

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

Reply