neo4j-contrib / neo4j-tableau

Neo4j Tableau Integration via WDC
https://neo4j-contrib.github.io/neo4j-tableau/website/Neo4jWdc2.html
59 stars 22 forks source link

epoch time conversion wrongly handled #5

Closed sasimachi closed 6 years ago

sasimachi commented 6 years ago

I have stored the date value in epoch format in one of the neo4j nodes and while fetching that in tableau using this WDC, it tries convert into integer and giving me wrong(negative number) values.

Please help me to fix this.

jexp commented 6 years ago

It's probably due to Javascript not being able to transport integers > 52bit

Or divide them by 1000 so you get second-resolution.

Can you format them as date strings? e.g. with apoc.date.format(n.date) ?

sasimachi commented 6 years ago

this issue is resolved by reading the parameter as string in the query itself and then later converting it to the required date format. Ex:

MATCH (e:Event) return toString(e.start) as eventStart.

sarah-scribestar commented 6 years ago

Hi, I have a similar issue with datetimes. We store them as strings "2017-04-26T11:25:45.020008+00:00" When I use the WDC they come in as null. I exported the data into a csv and it was empty. I've tried calculated fields and changing the data type to no avail.

Does anyone have any advice please?

jexp commented 6 years ago

Can you share the query that you use @sarah-scribestar ?

sarah-scribestar commented 6 years ago

Hi jexp, thanks for responding.

I have tried: match (d:Document) return d.Id as Id, d.Name as Name, d.CreatedOn as Created

We have neo4j version 3.3.0 and Tableau 10.5

The name and Id comes through fine. I've tried just returning "d" and I've tried different node types which also have dates.

Thanks

sasimachi commented 6 years ago

Can you try with this query:

match (d:Document) return d.Id as Id, d.Name as Name, to.string(d.CreatedOn) as Created

and convert the column using epoch conversion functions through calculated field in tableau desktop?

sarah-scribestar commented 6 years ago

Hi Sasimachi,

Thanks for replying. I tried with Tostring (to.string doesn't work but I'm guessing that was a typo?)

It still comes in as nulll. I've tried adding calculated fields with and without quotation marks and it says they are valid but still null.

DATE("[Created]") DATETIME("[Created]") DATE([Created]) DATETIME([Created])

When I go to Data > export data to CSV the date results are blank, but the other results (id & name) are fine. So despite the query working in the browser it doesn't seem to be importing all the data into tableau.

Thanks, Sarah

jexp commented 6 years ago

Can you show the query results from browser?

And do you have a sample graph to reproduce?

The only thing that I could imagine is the numeric handling of the JS driver which is a bit odd. And the Tableau connector tries to turn that into a number. Perhaps there is an issue there.

So an example dataset would help.

sarah-scribestar commented 6 years ago

Hi,

Thanks for trying to help!

browseroutput

Or:

Id Name Created
"353f025d-b2b8-4691-bd68-579d53194108" "1MEQCvDkQBIRfwrxAC3aZUtq8bY9AKU7tXpzPk4OBq2PqA+cZLRJHA6Mpo6Kt4jcGHJ4fNgSHHlzPGNcMe/3DwazFJfiJC2vAz5wL2lIkoahRpuw+KNDJHBKpD7q0nFQ" "2017-04-26T11:25:45.020008+00:00"

Tableau does classify "Created" as a date & time. Changing it to something else doesn't do anything.

If you aren't sure, please don't worry. I can try and explore some other options.

Thanks, Sarah

jexp commented 6 years ago

Really weird b/c that's just a regular string. No idea why tableau doesn't like it?

sarah-scribestar commented 6 years ago

No idea, thanks for the help though!