Posts

R and Shiny App, a path from data engineering to web app deployment in one language

Image
In data analytics, nowadays, R and Python are the most popular languages among data professional beside SQL. I am struggling myself to identify which language to focus. I also saw a lot of questions about this topic and there is no clear answer. The general idea is to pick one and be good at it then traverse to the other if needed. In my opinion, R and Python are pretty compatible in analytic field. Recently, this changed when RStudio came up with Shiny App. This allows us to create data layer and UI layer (HTML, Javascript) with only R. After that, without standing up a web server to house your application, you can publish your app to shinyapp.io and ready for consumption. With this, my love for R grew bigger than Python ... at the moment :D I have developed the following simple Guessing Game , deployed and ready for consumption within 30 mins. To my fellow developer coming from business side, it is true that you can now develop and deploy a web app, dashboard by yourself with R. Plea

PostgreSQL Date table

Image
Using recursive in SQL, I can create a sequence that make up a date table. Basic recursive With   recursive  a  as   ( Select   1   as  Num union Select  Num +  1 From  a Where  Num +  1  <  11 ) Select  *  from  a Postgres SQL bucket date to 5 mins interval WITH   recursive  dimdatecreator( date )  AS   (          SELECT  (to_timestamp( '2020-01-01' , 'YYYY-MM-DD HH24:MI:SS' ))  AS   date   -- Start Date          UNION ALL           SELECT   date  + interval  '00:05'           FROM    dimdatecreator          WHERE    date  <= (to_timestamp( '2020-01-31' , 'YYYY-MM-DD HH24:MI:SS' ))  -- End Date  )  SELECT   date ,         date_part( 'hour' , date )+ 1         AS  hr,         (date_part( 'minute' , date )/ 5 )+ 1   AS  bucket  FROM    dimdatecreator;

PTO Tracker

Image
I built this project using R. The project came from my friend need of tracking PTO so he can plan for vacation. PTO Calculator Shinny App   Project repo:  https://github.com/Anhsnotes/PTOCalculation

Data Join and Blend in Tableau

Image
Joining and Blending Data in Tableau There are 2 main ways to combine data: Joins Combine tables by adding more columns of data across similar row structures. This can cause data loss or duplication if tables are at different levels of detail Blends Unlike joins, never truly combine the data   Blends query each data source independently, the results are aggregated to the appropriate level, then the results are presented visually together in the view.   Because of this, blends can handle different levels of detail and working with published data sources. Blends are also established individually on every sheet and can never be published, because there is no true “blended data source”, simply blended results from multiple data sources in a visualization. Differences between joins and data blending Data blending simulates a traditional left join. (The Primary Data  left join  Secondary Data) The main difference between the two is when the aggregation is perfor

Coursera Final Project

Image
Suggesting Ideal Location to open a Restaurant in Reno Metropolitan area 1. Introduction 1.1 Background The Reno area is growing due to big companies like Tesla, Panasonic, Google, Apple and Amazon coming in. There are opportunities for small businesses to support the growing population. Investors, with background in restaurant industry, are interested in opening a new restaurant in the Reno area to capture the opportunity. 1.2 Problem This research will identify possible store locations with their competitive advantage and rank them from most favorable to least favorable. 1.3 Interest This is a big investment and location is the first decision that investors need to make. To better ensure the success of their investment, they would like to know where should they open the store and how is the competitive advantage they have based on the location 2. Data acquisition and cleaning 2.1 Data sources Main data source is obtained through Foursquare API call. We will cap