A few months ago all of my data sources was modified (probably after some backend update on the looker side) and all of my date fields converted to datetime. I was able to convert them back but since then i almost can not work with datetime_add and datetime_sub functions (i will use DTA and DTS abbreviations further occurances in this text).
So when i’m trying to ‘DTS(date_created, interval 1 day)’ it works just fine, but right after i’m changing the integer part to another field (i.e. new field WD that consist of formula ‘weekday(date_created)’) so that my formula becomes ‘DTS(date_created, interval WD day)’ it suddenly stops working and all of my charts give me this error:
Looker Studio cannot connect to your data set.
Failed to fetch data from the underlying data set
Error ID: 1b01a3fe
I’ve noticed that the charts are crashing even when i’m adding both new fields ‘DTS(date_created, interval 1 day)’ and ‘DTS(date_created, interval WD day)’ even though there is plain integer (and not field) part in DTS formula. But both of this fields works when they are added to chart separately.
This problem only started in around june-july, because before this time i had multiple fields with DTS expressions and field part in them and they all worked fine.
I’ve tried everything:
- putting not field but the expression itself in the integer part (i.e. datetime_sub(date, interval weekday(date_created) day))
- using different types of field (all of them was in the date&time “folder”)
- using cast function in expression
- trying fresh new test data source
Nothing worked, even if it worked it wouldn’t have explained why the error appears even when im trying to add two one-function fields. So i’ve tried to work around that and found that the only two functions that somehow messes with each other is the datetime_sub() (or datetime_add) and weekday(). When i’m adding field with DTS() and year() — works fine, when DTS() and format_datetime(‘%u’, date_created) — works fine too. But still doesn’t work when i’m combining ‘DTS(date_created, interval cast(format_datetime(‘%u’, date_created) as number) day)’.
So i’m asking for someone’s help, please explain to me, what is this **** and how should i deal with this?