Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 32

BUSINESS INTELLIGENCE

JOURNAL
INDEX

Sr. Title Date of Date of Sign


No. Experiment Submission

1 Installation of Power BI 7/12/23 8/12/23

2 Import the legacy data from Excel 14/12/23 15/12/23

3 21/12/23 22/12/23
Import the legacy data from Oracle data
source

4 Perform the Extraction Transformation & 4/01/24 5/01/24


Loading (ETL) Process to Construct the
Database in SQL Server/Power BI

Implementation of Classification algorithm


5 11/01/24 12/01/24
in R Programming

6 Demonstrate K-Means Clustering 18/01/24 12/01/24


Using R Programming

7 1/02/24 2/02/24
Data Analysis using Time Series Analysis

8 Prediction Using Linear Regression 8/02/24 9/02/24

Data Modelling and Analytics with Pivot


9 15/02/24 16/02/24
Table in Excel

10 Apply what if analyis for data 22/02/24 23/02/24


viualization ,design and generate necessary
report
PRACTICAL NO 1
INSTALLATION OF POWER BI
PRACTICAL NO 2
IMPORT THE LEGACY DATA FROM EXCEL
Importing Excel Data
1) Launch Power BI Desktop.

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/

Connect to an OData feed:


1) From the Home ribbon tab in Query Editor, select Get Data.
2) Browse to the OData Feed data source.

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

Step 2: Data Transformation :


The data transformation is second step. After extracting the data there is big need to do the
transformation as per the target system.
• Data Extracted from source system is in to Raw format. We need to transform it before
loading in to target server.
• Data has to be cleaned, mapped and transformed.
• There are following important steps of Data Transformation:
1. Selection: Select data to load in target
2. Matching: Match the data with target system
3. Data Transforming: We need to change data as per target table structures

Real life examples of Data Transformation:


• Standardizing data: Data is fetched from multiple sources so it needs to be standardized as
per the target system.
• Character set conversion: Need to transform the character sets as per the target systems.
(Firstname and last name example)
• Calculated and derived values: In source system there is first val and second val and in
target we need the calculation of first val and second val.
• Data Conversion in different formats: If in source system date in in DDMMYY format and
in target the date is in DDMONYYYY format then this transformation needs to be done at
transformation phase.
Step 3 : Data Loading
• Data loading phase loads the prepared data from staging tables to main tables.
ETL process in SQL Server:

ETL Process in Power BI


1) Remove other columns to only display columns of interest
In this step you remove all columns except ProductID, ProductName, UnitsInStock,
and QuantityPerUnit.
Power BI Desktop includes Query Editor, which is where you shape and transform your
data connections. Query Editor opens automatically when you select Edit from
Navigator. You can also open the Query Editor by selecting Edit Queries from the Home
ribbon in Power BI Desktop. The following steps are performed in Query Editor.
1. In Query Editor, select the ProductID, ProductName, QuantityPerUnit, and
UnitsInStock columns (use Ctrl+Click to select more than one column, or Shift+Click
to select columns that are beside each other).
2. Select Remove Columns > Remove Other Columns from the ribbon, or right-click on
a column header and click Remove Other Columns.
3. Change the data type of the UnitsInStock column
When Query Editor connects to data, it reviews each field and to determine the best data type.
For the Excel workbook, products in stock will always be a whole number, so in this step you
confirm the UnitsInStock column’s datatype is Whole Number.
1. Select the UnitsInStock column.
2. Select the Data Type drop-down button in the Home ribbon.
3. If not already a Whole Number, select Whole Number for data type from the drop down
(the Data Type: button also displays the data type for the current selection).
3. Expand the Order_Details table
The Orders table contains a reference to a Details table, which contains the individual
products that were included in each Order. When you connect to data sources with multiples
tables (such as a relational database) you can use these references to build up your query
In this step, you expand the Order_Details table that is related to the Orders table, to combine
the ProductID, UnitPrice, and Quantity columns from Order_Details into the Orders table.
This is a representation of the data in these tables:
The Expand operation combines columns from a related table into a subject table. When the
query runs, rows from the related table (Order_Details) are combined into rows from the
subject table (Orders).
After you expand the Order_Details table, three new columns and additional rows are added
to the Orders table, one for each row in the nested or related table.
1. In the Query View, scroll to the Order_Details column.
2. In the Order_Details column, select the expand icon ( ).
3. In the Expand drop-down:
a. Select (Select All Columns) to clear all columns.
b. Select ProductID, UnitPrice, and Quantity.
c. Click OK.
4. Calculate the line total for each Order_Details row
Power BI Desktop lets you to create calculations based on the columns you are importing, so
you can enrich the data that you connect to. In this step, you create a Custom Column to
calculate the line total for each Order_Details row.
Calculate the line total for each Order_Details row:
1. In the Add Column ribbon tab, click Add Custom Column.

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.

2. Click Scenario Manager.

The Scenario Manager dialog box appears.


3 Add a scenario by clicking on Add

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

8. Click on summary to get a summary on a separate sheet


9. Next, under what-if analysis, select goal seek

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

12. This is similar to scenario manager, except here the


scenarios is provided in a data table format.

You might also like