Grafana - Timeseries plot doesn't work (SQLite database) - sqlite

I've been trying to make a timeseries plot in Grafana, but I keep getting messages like "Data does not have a time field" or "No numeric fields found." How could I format my data to fix these issues? Thank you!

See README of used plugin first
https://grafana.com/grafana/plugins/frser-sqlite-datasource/ :
Your ts column is not formatted in accordance with RFC3339.
Your value_string is a string and not numeric - REAL type.

Reformat your time variable in SQLite to Unix time format, ie strftime("%s" , my_time_var ).
Then in the grafana query dialog define my_time_var as a time formatted column of a Time Series.
I don't know if it also works in Windows.

Related

Importing dates from excel (some formatted as dates some as numbers)

I am working an uploaded document originally from google docs downloaded to an xlsx file. This data has been hand entered & formatted to be DD-MM-YY, however this data has uploaded inconsistently (see example below). I've tried a few different things (kicking myself for not saving the code) and it left me with just removing the incorrectly formatted dates.
Any suggestions for fixing this in excel or (preferably) in R? This is longitudinal data so it would be frustrating to have to go back into every excel sheet to update. Thanks!
data <- read_excel("DescriptiveStats.xlsx")
ex:
22/04/13
43168.0
43168.0
is a correct date value
22/04/13
is not a valid date. it is a text string. to convert it into date you will need to change it into 04/13/2022
there are a few options. one is to change the locale so the 22/04/13 would be valid. see more over here: locale differences in google sheets (documentation missing pages)
2nd option is to use regex to convert it. see examples:
https://stackoverflow.com/a/72410817/5632629
https://stackoverflow.com/a/73722854/5632629
however, it is very likely that 43168 is also not the correct date. if your date before import was 01/02/2022 then after import it could be: 44563 which is actually 02/01/2022 so be careful. you can check it with:
=TO_DATE(43168)
and date can be checked with:
=ISDATE("22/04/13")

Attempting to parse a date with unicode in Tableau using DATEPARSE function

I am attempting to use Tableau's "DATEPARSE" function to get a standard date/time format... so far my attempts have failed.
The format of the raw unicode date is: 2022-08-01T08:00:00-04:00
I was successfully able to do the first part, but does anyone have an idea on the whole thing?
The first part: DATEPARSE("yyyy-MM-dd",[Date])
I figured it out:
DATEPARSE("yyyy-MM-dd'T'HH:mm:ssZ",[Date])

How to handle date time formats using VAEX?

I am new to VAEX. Also I couldn't find any solution for my specific question in google. So I am asking here hoping someone can solve my issue :).
I am using VAEX to import data from CSV file in my DASH Plotly app and then want to convert Date column to datetime format within VAEX. It successfully imports the data from csv file. Here is how I imported data from csv into VAEX:
vaex_df=vaex.from_csv(link,convert=True,chunk_size=5_000)
Below it shows the type of the Date column after importing into VAEX. As you can see, it takes the Date column as string type.
Then when I try to change data type of Date columns with below code, it gives error:
vaex_df['Date']=vaex_df['Date'].astype('datetime64[ns]')
I dont know how to handle this issue, so I need your help. What am I doing wrong here?
Thanks in advance
The vaex.from_csv is basically an alias to pandas.read_csv. In pandas.read_csv there is an argument that use can use to specify which columns should be parsed as datetime. Just pass that very same argument to vaex.from_csv and you should be good to go!

Teradata tpump utility

Iam trying to load some data using tpump utility from Unix Console.
The data has various datatypes viz., text, number, decimal, date.
Now, iam stuck as what should be the FORMAT type i need to specify in the tpump script.
I went through the tpump manual, but could not decipher the FORMAT type to used.
The data/columns are delimited by "|" symbol.
Any info/hint in using the appropriate FORMAT type would be of great help.
If this is a duplicate question, please help me with the actual question link.
Thanks a lot in advance.

How do I prevent data from displaying in scientific format?

I have this sql server query that I am running in my .net app.
(CONVERT(VARCHAR(8), EventDate, 112)+ substring(RequestedBy,1,1)+right( '0000000' + convert( varchar( 7 ), ContactID ), 7 )) as Contacts
It produces the following results in the following format:
20120731e0000001
20120731f0000002
20120731p0000003
This is the result and format that we want.
Problem is when we click on export icon to export these results to excel, the first one changes to the scientific format like 2.01E+08.
Any date that has e in the middle such as 20120731*e*0000001 turns into scientific data.
The rest is just fine.
Any ideas how to fix this?
I want to apologize in advance if I stick the wrong tag in the Tags section since I am not sure where the fix could come from.
The formatting is happening when Excel opens your exported file. Simply change the column to have "formatted text" of string so that it displays as the original format.
When you open the exported data file directly with Excel, all formats are set as General. In General format, Excel applies formatting to what it recognizes as numbers and dates. So, to be clear, the issue is not with your export, but rather with how Excel is reading your data by default. Try the following to get around this issue.
Export to CSV. Then, rather than opening the CSV in Excel, use Excel's 'Get External Data From Text' tool to import the data into an empty workbook. Here you can specify to treat this field as TEXT rather than as GENERAL.
Note that once Excel applies number (or date) format to a cell, the data in the cell has been changed. No application of a new format will bring back your desired data. For this reason you must specify the format before Excel opens the file.

Resources