Skip to main content

I have a date selector on a custom view: https://cityobservatory.birmingham.gov.uk/explore/dataset/percentage-universal-credit-claimants-in-employment-wmca-wards-2025/insight/ 

The date selector is based on the date field which is set to type of month. However its only showing years. How can I have this show months?

 

<div ods-facet-results="date" ods-facet-results-facet-name="date"
ods-facet-results-context="ctxfiltered" ods-facet-results-sort="-alphanum">
<ods-select
selected-values="ctxfiltered.parameterse'refine.date']"
multiple="false"
options="date"
label-modifier="name"
value-modifier="name"
placeholder="Date">
</ods-select>
</div>

 

Hello Danny,

If you take date facets, they automatically start with year, and within the years they have facets for the months etc.

In order to do what you want you need to feed the select widget with an advance analysis result : 


<div ods-adv-analysis="dateSelector"
ods-adv-analysis-context="ctxfiltered"
ods-adv-analysis-group-by="date_format(date, 'YYYY/MM') as dateSelect"
ods-adv-analysis-order-by="-date"
ods-adv-analysis-limit="100">
<ods-select label-modifier="dateSelect" multiple="false" options="dateSelector" placeholder="Date" selected-values="ctxfiltered.parameterss'refine.date']" value-modifier="dateSelect">
</ods-select>
</div>

 

If you need do do that again for another field I can recommend you using the API  console so you can build the list in any way you want and have immediate feedback on the request you want to create.

 

Best regards


Thomas, always coming up with the goods! Worked beautifully


Reply