2 Things: Odd Date/Time value and multiple tables into 1 excel sheet

Hello All, I have 2 questions.

  1. There is an odd Date/Time Stamp that is being reported out into Perspective table from SQL. see picture below. When I transfer the date to a .xlsx file, it goes back to a normal format. Just in Perspective it's weird. How do I fix it.

  2. As the picture suggests, i have multiple SQL table being generated on one sheet. More for data gathering rather than actual visual analysis. How can i get all 3 tables into one sheet. I currently have a button that our resident developer assisted us with for a different report. see below. Can I use this to get all of them into one workbook? of so, how?

	startdate = self.getSibling("DateTimeInput").props.value
	startdatestr = str(startdate)
	enddate = self.getSibling("DateTimeInput_0").props.value
	enddatestr = str(enddate)
	filename = startdatestr+'-'+enddatestr+' Short Raw Data.xlsx'
	data = self.getSibling("Table").props.data
	data = system.dataset.toExcel(True, [data])
	system.perspective.download(filename,data)

It's displaying the date in epoc time. You have to add a column definition to format it as a date. The field name has to match.

1 Like

Question 1:

Name the SQL field in each of the columns.0.field properties. e.g.
columns.0.field : Timestamp.
Then the rest of the properties will work.
columns.0.render : date
columns.0.dateFormat: YYYY-MM-DD

Question 2:

I have multiple SQL table being generated on one sheet.

Perspective doesn't have "sheets". Maybe you mean "view"?

How can i get all 3 tables into one sheet.

You already have, according to your previous statement.

Can you clarify?

There is just one table that it will download the the above code.. do I need to add the other table data names into this part to get separate tabs in the excel sheet? P.S. I don't code.. i dabble as best and can reuse things I already have. I'm Learning :slight_smile:

e.g.

`data = self.getSibling("Table","Table 2","Table 3").props.data`


I am going to add to this for us that are not coders. There is a Property on the left that is your column properties. see picture. When you click the "+" it will look like your other columns have disappeared. Have no fear, they are there. Keep pressing the "+" until all of your other columns are visible again. Then you can change the field property information as above to change the date...
image

I solved question 2... i needed to create the "data" datasets and then add them into the download like shown below. :slight_smile: YAY ME!!... lol

startdate = self.getSibling("DateTimeInput").props.value
	startdatestr = str(startdate)
	enddate = self.getSibling("DateTimeInput_0").props.value
	enddatestr = str(enddate)
	filename = startdatestr+'-'+enddatestr+' Short Raw Data.xlsx'
	L1data = self.getSibling("Line 1 Data").props.data
	L2data = self.getSibling("Line 2 Data").props.data
	L3data = self.getSibling("Line 3 Data").props.data
	data = system.dataset.toExcel(True, [L1data,L2data,L3data])
	system.perspective.download(filename,data)