Skip to main content
Question

Inconsistent data type behavior for date field in dataset

  • December 30, 2025
  • 1 reply
  • 3 views

boris.djakovic
Forum|alt.badge.img

Dear Support Team,

we have received the following request from a user regarding dataset https://data.bs.ch/explore/dataset/100120/, which we would like to forward to you for further investigation.

The user reports an inconsistency in the handling of the field vu_jahr:

  • The field is defined as a date in the dataset schema.

  • However, when exporting the dataset, the field appears to be delivered as a string.

  • When querying the dataset via ODSQL (using a SELECT vu_jahr GROUP BY vu_jahr query), the result returns proper datetime values (e.g. 2011-01-01 00:00:00+00:00, etc.).

This inconsistent behavior causes issues in the user’s synchronization process. While they have implemented a workaround on their side, they asked whether this could be fixed at the platform level.

Example query used by the user:
https://data.bs.ch/api/explore/v2.1/catalog/datasets/100120/exports/csv?lang=de&timezone=Europe%2FBerlin&use_labels=false&delimiter=%3B&select=vu_jahr&group_by=vu_jahr

Could you please check whether this behavior is expected and if there is a way to ensure consistent typing of this field across exports and API access?

Many thanks in advance for your support.

Kind regards,
Boris

1 reply

Thomas R.
Huwise Team
  • Huwise Team
  • December 30, 2025

Hello Boris,

 

Does the user expects on value as the export similar on what the dataset is displaying on the table UX, meaning the year in 4 characters?

I’m not 100% sure what do you mean about the date being delivered in string as there is no typing in CSV which you give as example of query that is problematic.

 

Best regards,

Thomas