Archive
Neo4j Date Functions
BI BigData Readers,
Please accept my apologies for writing a new post after a long time. Lately busy with a lot of other technology-related and upgrades.
Lately working with Neo4j Graph DB to implement Customer Journey Analytics using event-based data. While implementing customer journey analytics, handled different scenarios with Neo4j dates and timestamps. This article I’ll be showcasing a couple of examples to play with dates.
By the way following Cypher code snippets from Neo4j 3.4.9. Neo4j APOC Library is really strong and most of the help available there itself. Below code samples are using some important functions from APOC. You can still play with Temporal dates
Listing some useful Cypher statements to play with date functions including date difference for your reference.
// get system timestamp in epoch format you can use following Cypher statement RETURN timestamp(); RETURN apoc.date.currentTimestamp();
//get epoch value from date RETURN datetime('2019-02-04').epochMillis;
//system datetime RETURN apoc.date.format(timestamp()); RETURN apoc.date.format(timestamp(),'ms', 'yyyy-MM-dd hh-mm-ss');
//system datetime converted to Central timezone RETURN apoc.date.format(timestamp(),'ms', 'yyyy-MM-dd hh-mm-ss','America/Chicago');
//only system date RETURN date(apoc.date.format(timestamp(),'ms', 'yyyy-MM-dd'));
//convert Neo4j date to Central timezone RETURN date(apoc.date.format(timestamp(),'ms', 'yyyy-MM-dd',’America/Chicago’));
//get date difference between two dates. RETURN duration.inDays(date('2018-01-01'), date(apoc.date.format(timestamp(),'ms', 'yyyy-MM-dd',"America/Chicago"))).days;
Hope this helps.
Happy Graphing..!!!
Sandip Shinde
Bi-BigData 2013 Review
The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.
Here’s an excerpt:
The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 24,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 9 sold-out performances for that many people to see it.
Streaming Twitter Data to MongoDB Real-time
Lot of Developers/Applications which perform Analytics are pulling data from lot of Social Media Sources Like Facebook, Twitter, Blogs, News Channels like ReadIt. 99% of Social Media Data is not free but it’s mostly available for Developers to POC and Development purpose. This Article I will explain how you can we Stream Data from Twitters Real-time as Twitter offers only 1% of actual their activity stream data for free of cost. Read more…
PowerShell for Creating a Database Login
This is PowerShell tutorial script to walk you through how to create database login with the help of PowerShell and SMO. Read more…
Apache Hive Or Cloudera Impala? What is Best for me?
Hi Guys,
I’m not recommending anything Hive or Cloudera Impala here but just trying to express my experience with both the tools as noticed there is lot of puzzlement these days which one is best. Comparison between Hive and Impala is not fair. Simply I can say again it’s fully depend on your case study and your requirements on how fast you want to read data from Hadoop. Read more…
MongoDB Vs Neo4j GraphDB. It’s your Case Study..!!
I was working on one Social Media Streaming proof of concept where problem statement was which NoSQL Database is best fit for social media network. I’m big fan of MongoDB and I was planning to use MongoDB in this case but I wanted give another shot for other NoSQL databases where I chose Neo4j Graph Database. Read more…
PowerShell for Copy Database
This is PowerShell tutorial script to understand how to copy existing database with PowerShell and SMO. We will be using Transfer Class from SMO. If you wish to just generate the copy script then there is an option to just script out the transfer using the ScriptTransfer method. When we are ready to bring the data and schema over, we can use the TransferData method. Read more…
SQL Sever – PowerShell for Executing a SQL Query on Multiple Servers
This is 50th Article on Bi-BigData.com and we are getting great response from the community. This article will be covering how to use PowerShell and SMO to connect multiple SQL Server instances and execute a pre defined SQL command against all of them. This is applicable when we have same database available on multiple SQL Server Instances where you want to execute same SQL query. We are going to use the Invoke-Sqlcmd cmdlet to achieve our mission. Read more…
PowerShell tutorial Part 1- Poweshell for Creating View
Powershell Tutorial Part 1 – Powershell for Creating View
This article I’ll explain how to create SQL Server View using PowerShell and SMO. This PowerShell Script is compatible with PowerShell V3.0.
I’ll be using Production.ProductCategory, Production.ProductSubCategory and Production.Product tables to create view. Following t-SQL script is equivalent script which we will write in PowerShell later. Read more…
PowerShell for Execute SQL Query
Invoke-Sqlcmd cmdlet which is all-purpose SQL utility cmdlet being used in PowerShell. As the name suggests, Invoke-Sqlcmd cmdlet allows you to run T-SQL code or scripts and commands supported by the SQLCMD utility. It also allows you to run XQuery code. In this article, we will be looking at two ways of using Invoke-Sqlcmd. Read more…