Archive

Author Archive

Neo4j Date Functions

February 5, 2019 Leave a comment

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

January 1, 2014 Leave a comment

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.

Click here to see the complete report.

Streaming Twitter Data to MongoDB Real-time

December 16, 2013 7 comments

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…

Apache Hive Or Cloudera Impala? What is Best for me?

July 10, 2013 5 comments

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..!!

April 30, 2013 2 comments

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

March 25, 2013 13 comments

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

March 14, 2013 13 comments

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

March 10, 2013 5 comments

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

March 10, 2013 5 comments

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…

%d bloggers like this: