Journal
Journal
JOURNAL
INDEX
3 21/12/23 22/12/23
Import the legacy data from Oracle data
source
7 1/02/24 2/02/24
Data Analysis using Time Series Analysis
2) From the Home ribbon, select Get Data. Excel is one of the Most Common data
connections, so you can select it directly from the Get Data menu.
3) If you select the Get Data button directly, you can also select FIle > Excel and select
Connect.
4) In the Open File dialog box, select the Products.xlsx file.
5) In the Navigator pane, select the Products table and then select Edit.
PRACTICAL NO 3
IMPORT LEGACY DATA FROM ORACLE DATA SOURCE
In this task, we'll bring in order data. This step represents connecting to a sales system. You
import data into Power BI Desktop from the sample Northwind OData feed at the following
URL, which you can copy (and then paste) in the steps below:
http://services.odata.org/V3/Northwind/Northwind.svc/
3) In the OData Feed dialog box, paste the URL for the Northwind OData feed.
4) Select OK.
5) In the Navigator pane, select the Orders table, and then select Edit.
PRACTICAL NO 4
PERFORM THE EXTRACTION, TRANSFORMATION AND
LOADING (ETL) TO CONSTRUCT THE DATABASE IN SQL
SERVER AND POWER BI
Step 1 : Data Extraction :
The data extraction is first step of ETL. There are 2 Types of Data Extraction
1. Full Extraction : All the data from source systems or operational systems gets extracted to
staging area. (Initial Load)
2. Partial Extraction : Sometimes we get notification from the source system to update
specific date. It is called as Delta load.
Source System Performance: The Extraction strategies should not affect source system
performance
2. In the Add Custom Column dialog box, in the Custom Column Formula textbox, enter
[Order_Details.UnitPrice] * [Order_Details.Quantity].
3. In the New column name textbox, enter LineTotal.
4. Click OK
PRACTICAL NO 5
IMPLEMENTATION OF CLASIFICATION ALGORITHM IN
R PROGRAMMING
Consider the annual rainfall details at a place starting from January 2012. We create an R
time series object for a period of 12 months and plot it.
rainfall<-c(799,1174.8,865.1,1334.6,635.4,918.5,685.5,998.6,784.2,985,882.8,1071)
> rainfall.timeseries<-ts(rainfall,start=c(2022,1),frequency=12)
> print(rainfall.timeseries)
> bitmap png(file="rainfall.png")
> plot(rainfall.timeseries)
> dev.off()
Output:
When we execute the above code, it produces the following result and chart −
PRACTICAL NO 6
DEMONSTRATE K MEANS CLUSTERING USING R
Code:
newiris<-iris
newiris $Species<-NULL
(kc<-kmeans(newiris,3))
table(iris Species,kc$cluster)
plot(newiris[c("Sepal.Length","Sepal.Width")],col=kc$cluster)
points(kc$centers[,c("Sepal. Length","Sepal. Width")],col=1:3,pch-8,cex=2)
Compare the Species label with the clustering result
Plot the clusters and their centre
PRACTICAL NO 7
DATA ANALYSIS USING TIME SERIES ANALYSIS
Time series is a series of data points in which each data point is associated with a timestamp.
A simple example is the price of a stock in the stock market at different points of time on a
given day. Another example is the amount of rainfall in a region at different months of the
year. R language uses many functions to create, manipulate and plot the time series data. The
data for the time series is stored in an R object called time-series object. It is also a R data
object like a vector or data frame.
The time series object is created by using the ts() function.
PRACTICAL NO 8
PREDICTION USING LINEAR REGRESSION (A)
In Linear Regression these two variables are related through an equation, where exponent
(power) of both these variables is 1. Mathematically a linear relationship represents a straight
line when plotted as a graph. A non-linear relationship where the exponent of any variable is
not equal to 1 creates a curve.
y = ax + b is an equation for linear regression. Where, y is the response variable, x is the
predictor variable and a and b are constants which are called the coefficients.
A simple example of regression is predicting weight of a person when his height is known.
To do this we need to have the relationship between height and weight of a person.
The steps to create the relationship is –
• Carry out the experiment of gathering a sample of observed values of height and
corresponding weight.
• Create a relationship model using the lm () functions in R.
• Find the coefficients from the model created and create the mathematical equation using
these
• Get a summary of the relationship model to know the average error in prediction. Also
called residuals.
• To predict the weight of new persons, use the predict () function in R.
PRACTICAL NO 8
PREDICTION USING LINEAR REGRESSION (B)
Following is the description of the parameters used –
• Object is the formula which is already created using the lm() function.
• newdata is the vector containing the new value for predictor variable.
# Create the predictor and response variable.
x <- c(151, 174, 138, 186, 128, 136, 179, 163, 152, 131)
y <- c(63, 81, 56, 91, 47, 57, 76, 72, 62, 48)
relation <- lm(y~x)
# Give the chart file a name.
png(file = "linearregression.png")
# Plot the chart. plot(y,x,col = "blue",main = "Height & Weight Regression",
abline(lm(x~y)),cex = 1.3,pch = 16,xlab = "Weight in Kg",ylab = "Height in cm")
# Save the file.
dev.off()
When we execute the above code, it produces the following result –
PRACTICAL NO 9
DATA MODELING AND ANALYTICS WITH PIVOT TABLE
IN EXCEL
Data Model is used for building a model where data from various sources can be combined
by creating relationships among the data sources. A Data Model integrates the tables,
enabling extensive analysis using PivotTables, Power Pivot, and Power View.
A Data Model is created automatically when you import two or more tables simultaneously
from a database. The existing database relationships between those tables is used to create the
Data Model in Excel.
Step 1 − Open a new blank Workbook in Excel.
Step 2 − Click on the DATA tab.
Step 3 − In the Get External Data group, click on the option From Access. The Select Data
Source dialog box opens.
Step 4 − Select Events.accdb, Events Access Database file.
PRACTICAL NO 10
APPLY THE WHAT-IF ANALYSIS FOR DATA
VISUALIZATION, DESING AND GENERATE NECESSARY
REPORTS
1. On the Data tab, in the Forecast group, click What-If Analysis.
4. Type a name (60% highest), select cell C4 (% sold for the highest price) for the Changing
cells and click on OK.
5. Edit the scenario by giving required information
6. Edited scenario will be visible in the window.
7. Create many such scenarios and click on show to see the results
10. In the window, select the goal cell, set a goal and select which cell needs to
change.
11.Under what-if analysis, select Data Table