New error on old dashboard / worksheet "Error cannot cast type bigint to timestamp with time zone"

I have a worksheet which feeds a widget on a dashboard, and I generally only check it once a month. It worked last month (and has for the past year) but it stopped working recently.

I am using it to find the average order value in a given month to track m/m changes.

The data I am pulling from uses timestamps. The worksheet has always been fine converting the timestamp to a date, so that I could limit it to only show me transactions in the most recent complete month.

I went to pull the data for my report today, and the worksheet no longer works. I get the error “Error
cannot cast type bigint to timestamp with time zone”. Nothing has changed since last month, it simply no longer works. The worksheet wont pull any data.

If I take that column and unconvert it, the worksheet loads. but I need it converted to dates, so that I can limit the view to the most recent complete month.

Has anyone else had this happen to them recently, or know a work around?

1 Like

Darien was able to help me.

Instead of using the menu to convert like it was set up, I just changed the logic on the column directly

“DateFromUnix([Custom SQL/eventtimestamp])” in my case.

This worked fine in case anyone else has a similar issue.

Darien is going to look into why the logic from the convert option in the column drop down does not work like it used to. (at least in my case it doesnt)

@shawn welcome to the community and thank you for posting the solution here.

While something could have certainly changed in your Postgres DB with regards to the column in question, Sigma should never issue invalid SQL.
In your case it looks like we tried to directly cast a bigint to timestamptz in the conversion. I’m filing a bug internally and will follow-up with you via your support ticket.
Meanwhile the workaround should work for anyone hitting this, at least on a Postgres database.