How to change a column to datetime in Apache Superset table configuration? - apache-superset

I'm getting this error message:
Datetime column not provided as part table configuration and is required by this type of chart
I'd like to create a chart showing change in total volume over time. I have a date field created as a column that I'd like to use as a datetime but cannot figure out how.
Data is an uploaded .csv file.
How do you change a column to datetime in table configuration?

How do you change a column to datetime in table configuration?
You should be fine casting that column to a timestamp instead.
Superset complains about a missing datetime column because it's written in Python; but assuming you're querying a postgres DB, the equivalent type would be timestamp.
If your datasource is based off a query; you should be able to cast the date type to timestamp (use ::timestamp or to_timestamp()) and use that as your "datetime" column.

In process of uploading the CSV file, we should set up names of columns with dates:

check if you have date or time series in your data once you make sure of that,if the format of the date just year, then the DATETIME format is this '%Y'.
if the format is yyyy/mm/dd then the DATATIME format is "%Y/%m/%d" and for the rest of the formats check here
all these formats had to be edited in the edit dataset window in supersetclick here for image
go with the documentation it helps a lot.

Define in CSV to Database configuration before uploading:

Related

Date format in Google Cloud Storage changes date to YYYY-DD-MM format

I upload data to Google Cloud Storage from CSV. The data in CSV is in dd/mm/yyyy format (in my example it is 05/09/2022 or 5th of September) and according to the metadata settings, I can see the default date is mm/dd/yyyy and it reads the date as 9th of May. How can I solve this issue and make GCP to read the date in dd/mm/yyyy format?
You can do this at the query level only. There is no way to change the format directly.
Also as mentioned above in comments, the custom time field does not represent the date format of the underlying data. You can refer to this document.
According to the documentation,format string represents the textual form of date and time and contains separate format elements that are applied left-to-right. Load the csv with all date columns as string, and parse them manually as date in a query.
Additionally you can check this stackoverflow link1 & link2

Zulu time conversion in a calculated table

I'm using PowerBI to build a calculated table to do time calculation on an existing table.
calc_issues = CALCULATETABLE(
SELECTCOLUMNS('public issues', "created_at_dt", 'public issues'[created_at], "closed_at_dt", 'public issues'[closed_at]))
Both these columns are text in my original database and are imported as text in this calculated table. When I try to switch this calculated table into a Date/Time I get the following issue:
Cannot convert value '2021-09-09T14:55:11Z' of type Text to type Date while processing column.
Now if I go into my database table and convert the text into Date/Time there's error. But I want this new calculated table to show specific Date/Time calculations.
When I try to create a new column and try to do a DATEVALUE on the text I get the same error.
Solution: Power Editor doesn't modify the existing database table when using direct.
The query editor can be used to convert the text into time stamps. I loaded your data sample into Power Query in a blank query and it was converted automatically, even converting Zulu to my local time.
If you don't want to convert to local time, then remove the Z from the text by extracting the first 19 characters of the text, then change the data type.

Synapse CopyData Tool Changing datetime to int96

So I'm pulling items from a database via a query to put that data into a datalake. All that works great, the preview comes out wonderfully on the source tab. On the Mapping tab however, Whenever I hit "Import Data" or even input the "StartDate" column manually to a blank mapping (which is a datetime in the source DB) -- it changes the startdate to int96. Then, once I pull this data into PBI obviously I have to do a BUNCH of weird massaging to get the int96 back to a datetime. It's rediculous.
Here is a pic of what's happening.
Does anybody know why this is happening or what I can do to map the sink column as a datetime? I can't seem to change the type anywhere.
Parquet internally stores dates as integers, but the clients, including Power BI should automatically convert them back to dates. EG this works fine for me, with a parquet file created as you indicate.
let
Source = AzureStorage.DataLake("https://xxxx.dfs.core.windows.net/datalake/stage/xxx.parquet"),
f = Source{[#"Folder Path"="https://xxxx.dfs.core.windows.net/datalake/stage/",Name="xxx.parquet"]}[Content],
#"Imported Parquet" = Parquet.Document(f)
in
#"Imported Parquet"

Power Bi date error when importing excel file

SO when I import this excel file with invoice_date column as 12/1/2010 8:26 there is an error popup and when I click on view errors it takes me to Power Query Editor where all the values in the date column are displayed as an error.
I tried changing type using Locale but it didn't work.
you may try changing Windows Regional settings.
day/month/year
https://support.microsoft.com/en-us/office/change-the-windows-regional-settings-to-modify-the-appearance-of-some-data-types-edf41006-f6e2-4360-bc1b-30e9e8a54989?ui=en-us&rs=en-us&ad=us
Is there data formatted in excel as a date? If so, change it to text and import again. that way you can try and convert to datetime field from there and get more information on why it isnt converting if it doesnt.
Also, review your data. Has something got into the datetime column that isnt datetime?
You can avoid this by splitting the date/time column in the PowerQuery transform stage in a Date column and a Time column.

Format date field in Power BI service

I have imported an Excel file to Power BI service from my OneDrive for Business.
The file contains a simple Excel table and one of the fields is a date.
Now, in Power BI service, I get that field displayed as a whole number which isn't very useful to read in a report.
How do I change the field to display as date?
Thanks!
We can use FORMAT() method to format date value, Use below mentioned formula
Syntax: Column = FORMAT(Table[column],"MM/DD/YYYY")
Column = FORMAT(DailyActiveUsers[startDate],"MM/DD/YYYY")
Before my data:
After my data:
This usually works by default for true Excel dates. Anyway, just open the Edit Queries window and navigate to your table. In the column header for your Date, change the Data type to Date. Close & Apply to see the result in your report.