tableau - Cannot use calculated offset in BigQuery's DATE_ADD function -
i'm trying create custom query in tableau use on google's bigquery. goal have offset parameter in tableau changes offsets used in date based clause.
in tableau this:
select date_add(utc_usec_to_month(current_date()),<parameters.offset>-1,"month") month_index, count(distinct user_id, 1000000) distinct_count [orders] order_date >= date_add(utc_usec_to_month(current_date()),<parameters.offset>-12,"month") , order_date < date_add(utc_usec_to_month(current_date()),<parameters.offset>-1,"month")
however, bigquery returns error:
error: date_add 2nd argument must have int32 type.
when try same query in bigquery editor using simple arithmetic fails same error.
select date_add(utc_usec_to_month(current_date()),5-3,"month") month_index, [orders]
any workaround this? option far make multiple offsets in tableau, seems.
thanks help!
i acknowledge hole in functionality of date_add. can fixed, take time until fix rolled production.
Comments
Post a Comment