R-22 Data Visualization - R Programming Power Bi Lab Record
R-22 Data Visualization - R Programming Power Bi Lab Record
R PROGRAMMING / POWER BI
LABORATORY MANUAL
B.TECH CSE & CSD
[II YEAR – I SEM (R-22)]
(A.Y: 2023-2024)
Prepared by,
Dr. N. RAMANA REDDY
M.Tech(CSE), MBA, Ph.D
Associate Professor & HOD
Ph. No: 9640789300
Vision
* To achieve high quality in technical education that provides the skills and attitude to
adapt to the global needs of the Information Technology sector, through academic and
research excellence.
Mission
* To equip the students with the cognizance for problem solving and to improve the
teaching learning pedagogy by using innovative techniques.
* To strengthen the knowledge base of the faculty and students with motivation towards
possession of effective academic skills and relevant research experience.
* To promote the necessary moral and ethical values among the engineers, for the
betterment of the society.
Quality Policy
* Strives to inculcate the students with the world class Technical Knowledge,
Entrepreneurial Competence and Social Ethics by providing continual improvement and
innovation in the curriculum; based upon well-defined measurements and best practices.
To facilitate the graduates with the technical skills that prepare them for immediate
employment and pursue certification providing a deeper understanding of the
technology in advanced areas of computer science and related fields, thus
encouraging to pursue higher education and research based on their interest.
To facilitate the graduates with the soft skills that include fulfilling the mission,
setting goals, showing self-confidence by communicating effectively, having a
positive attitude, get involved in team-work, being a leader, managing their career
and their life.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
3. Design / development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for the
public health and safety, and the cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to
provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with an
understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance : Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a team, to
manage projects and in multi disciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change
DV – RP/POWER BI LAB 2023-24
Students are advised to come to the laboratory at least 5 minutes before (to the
starting time), those who come after 5 minutes will not be allowed into the lab.
Plan your task properly much before to the commencement, come prepared to
the lab with thesynopsis / program / experiment details.
Laboratory observation notes with all the details (Problem statement, Aim,
Algorithm, Procedure,Program, Expected Output, etc.,) filled in for the lab session.
Laboratory Record updated up to the last session experiments and other utensils (if
any) needed in the lab.
Sign in the laboratory login register, write the TIME-IN, and occupy the computer
system allotted to you by the faculty.
Execute your task in the laboratory, and record the results / output in the lab
observation notebook,and get certified by the concerned faculty.
All the students should be polite and cooperative with the laboratory staff, must
maintain thediscipline and decency in the laboratory.
Computer labs are established with sophisticated and high end branded systems,
which should be utilized properly.
Students / Faculty must keep their mobile phones in SWITCHED OFF mode during
the lab sessions. Misuse of the equipment, misbehaviors with the staff and systems
etc., will attract severe punishment.
Students must take the permission of the faculty in case of any urgency to go out; if
any body found loitering outside the lab / class without permission during working
hours will be treated seriously and punished appropriately.
Students should LOG OFF/ SHUT DOWN the computer system before he/she leaves
the lab after completing the task (experiment) in all aspects. He/she must ensure the
system / seat is keptproperly.
COURSE OBJECTIVES:
Students will be able to
Effective use of Business Intelligence (BI) technology (Tableau) to apply data
visualization
To discern patterns and relationships in the data.
To build Dashboard applications.
To communicate the results clearly and concisely.
To be able to work with different formats of data sets.
COURSE OUTCOMES:
At the end of the course, Students will be able to:
Understand How to import data into Tableau.
Understand Tableau concepts of Dimensions and Measures.
Develop Programs and understand how to map Visual Layouts and Graphical Properties.
Create a Dashboard that links multiple visualizations.
Use graphical user interfaces to create Frames for providing solutions to real world
problems.
Reference Books:
1. 1. Data visualization with python: create an impact with meaningful data insights using
interactive and engaging visuals, Mario Dobler, Tim Grobmann, Packt Publications, 2019
2. Practical Tableau: 100 Tips, Tutorials, and Strategies from a Tableau Zen Master, Ryan
Sleeper, Oreilly Publications, 2018
3. Data Visualization with R: 111 Examples by Thomas Rahlf, Springer, 2020
DV – RP/POWER BI LAB 2023-24
TABLE OF CONTENTS
Structuring your data, Sorting and filtering Tableau data, Pivoting Tableau
6
data. 27-28
Advanced Visualization Tools: Using Filters, Using the Detail panel,
7
using the Size panels,
customizing filters, Using and Customizing tooltips, Formatting your -
data with colors.
10 Creating custom charts, cyclical data and circular area charts, Dual Axis
charts. -
DV – RP/POWER BI LAB 2023-24
Data visualization is the practice of translating information into a visual context, such as
a map or graph, to make data easier for the human brain to understand and pull insights
from. It is the representation of information and data through use of common graphics,
such as charts, plots, infographics, and animations. Data visualization is a powerful way
for people, especially data professionals, to display data so that it can be interpreted
easily.
Data visualization tools provide the ability to see and understand data trends, outliers,
and patterns in an easy, intuitive way. There are various data visualization tools available.
One must choose the tool based on various factors such as its ease of use, types of
graphical representations the tool can produce, size of the dataset the tool can handle etc.
some of Data Visualization tools are Tableau, Power BI, Google Charts, JupyteR,
Grafana etc.
Introduction to R Programming:
R is a programming language and free software developed by Ross Ihaka and Robert Gentleman
in 1993. R possesses an extensive catalog of statistical and graphical methods. It includes
machine learning algorithms, linear regression, time series, statistical inference to name a few.
Most of the R libraries are written in R, but for heavy computational tasks, C, C++ and Fortran
codes are preferred. R is not only entrusted by academic, but many large companies also use R
programming language, including Uber, Google, Airbnb, Facebook and so on.
This feature helps to perform tasks like sorting, comparing and analyzing, very easily and fast.
Power BI is also compatible with multiple sources, including Excel, SQL Server, and cloud-
based data repositories which makes it an excellent choice for Data Scientists.
Power BI gives the ability to analyze and explore data on-premise as well as in the cloud. Power
BI provides the ability to collaborate and share customized dashboards and interactive reports
across colleagues and organizations, easily and securely.
Microsoft's Power BI tool. The certification primarily revolves around data transformation,
exploration, and visualization techniques. Industries commonly use these tools and certifications
for data-driven decision making, forecasting, complex analysis, and reporting. By integrating R
with Power BI, businesses can enhance the level of complexity and flexibility in their data
analytics processes.
Power BI’s Components:-
Power BI consists of various components which are available in the market separately and can
be used exclusively.
Power BI Desktop:-
Power BI is a free application that can be downloaded and installed on the system. It can be
connected to multiple data sources. Usually, an analysis work begins in Power BI
Desktop where report creation takes place. The report is then published to Power BI
service from where it can be shared to the Power BI Mobile apps so that people can view the
reports even on mobiles.
What is Data?
Data refers to raw facts, statistics, or information collected or stored in a structured or
unstructured form. Data can take various forms, such as text, numbers, images, videos, and
more. It is the foundation of all information and knowledge and is used in various fields for
analysis, decision-making, and understanding trends and patterns.
Unstructured Data: Unstructured data lacks a specific format and can include text
documents, social media posts, images, audio recordings, and more. Analyzing
unstructured data often requires advanced techniques like natural language processing
and image recognition.
Open Data Portals: Many governments and organizations provide free access to a wide
range of data through open data portals. Examples include Data.gov (United States) and
data.gov.uk (United Kingdom).
Data Repositories: Academic institutions, research organizations, and data enthusiasts
often share datasets on platforms like Kaggle, GitHub, and the UCI Machine Learning
Repository.
APIs (Application Programming Interfaces): Some websites and services offer APIs
that allow you to programmatically access and retrieve data. Examples include Twitter
API, Google Maps API, and financial market APIs.
Web Scraping: You can extract data from websites using web scraping tools and
libraries like BeautifulSoup and Scrapy. However, be mindful of the website's terms of
use and legal restrictions.
Surveys and Surveys: You can conduct your own surveys or collect data through
questionnaires and interviews.
IoT Devices: Internet of Things (IoT) devices generate vast amounts of data that can be
used for various purposes.
Commercial Data Providers: Some companies specialize in selling datasets for specific
industries, such as market research, finance, and healthcare.
Data Analysis: Before creating visualizations, you should thoroughly analyze your data
to understand its structure, relationships, and any patterns or trends. Exploratory data
analysis (EDA) techniques can help with this.
Statistical Knowledge: Understanding basic statistics is essential for making meaningful
interpretations of data. Concepts like mean, median, standard deviation, and correlation
are commonly used in data visualization.
Domain Knowledge: Having knowledge of the specific domain or subject matter related
to your data is crucial for creating contextually relevant visualizations. It helps you ask
the right questions and provide valuable insights.
Visualization Tools: Familiarize yourself with data visualization tools and libraries such
as matplotlib, Seaborn, ggplot2, D3.js, and Tableau. Each tool has its strengths and can
be used for different types of visualizations.
Design Principles: Study design principles, including color theory, typography, and
visual hierarchy, to create visually appealing and effective visualizations. Avoid common
pitfalls like misleading visualizations.
Interactivity: Learn how to add interactive elements to your visualizations to engage
users and allow them to explore the data. This can be achieved using tools like
JavaScript, Python libraries, or dedicated visualization software.
Week 2: Getting started with Tableau Software using Data file formats,
connecting your Data to Tableau,creating basic charts(line, bar charts, Tree
maps),Using the Show me panel.
Aim:- Getting started with Tableau Software using Data file formats, connecting your Data to
Tableau,creating basic charts(line, bar charts, Tree maps),Using the Show me panel.
Solution:- Getting started with Tableau software is a great way to create data visualizations
quickly and efficiently. Here are the steps to get started, including connecting your data to
Tableau, creating basic charts like line charts, bar charts, and treemaps, and using the Show Me
panel:
3.3 Choose the data source type (e.g., Excel, CSV, text file) and Select the data file(P6-
SuperStoreUS-2015.xls) and click "Open".
3.4 Drag any table(e.g. Orders) into working area.
2. Then Tableau will automatically create a line chart. You can customize it by adding labels,
titles, and formatting.
b. Bar Chart:
1. Drag and drop a categorical field (e.g., product category, region) to the Columns shelf and
a numeric field to the Rows shelf.
2. Then Tableau will create a bar chart. You can adjust the orientation and formatting as needed.
To display Labels on the bars click on Lables and select "Show mark lables".
c. Treemap:
1. Drag and drop a categorical field to the Columns shelf.
2. Drag and drop a numeric field to the Size shelf.
3. Tableau will create a treemap visualization. You can further customize it by adjusting colors
and labels.
Solution:- Tableau offers a powerful set of calculation tools that allow you to manipulate,
transform, and analyze your data in various ways. Here's an overview of some key concepts
related to Tableau calculations, including SUM, AVG (average), and aggregate functions, as
well as creating custom calculations and fields.
Aggregate Functions:
Tableau provides a range of aggregate functions that allow you to perform calculations on
groups of data. Common aggregate functions include SUM, AVG, COUNT, MIN (minimum
value), and MAX (maximum value). These functions are particularly useful when you want to
analyze data at different levels of granularity (e.g., by category, region, or time period).
Alternatively, you can create a calculated field by right-clicking on a shelf in your worksheet and
choosing "Create Calculated Field".
2. Enter Your Calculation:
In the calculated field editor, you can use functions, operators, and field references to define your
calculation.
For example, you can create a calculated field to calculate profit margin as (SUM([Profit]) /
SUM([Sales])) * 100.
3. Name and Save the Calculated Field:
Give your calculated field a meaningful name.
Click the "OK" or "Apply" button to save the calculated field.
Formatting Visualizations
Tableau provides a wide range of formatting options to make your visualizations more appealing
and informative:
1. Format Pane:
On the left side of the Tableau interface, you'll find the Format pane. It allows you to format
various aspects of your visualization, such as fonts, colors, lines, shading, and borders. Simply
select the element you want to format and use the options in the Format pane to make changes.
2. Marks Card:
The Marks card, located above your visualization, offers formatting options specific to the type
of marks you're using (e.g., color, size, label). Click on the Marks card to access these options
and modify how your data is represented.
2. Worksheet Menu:
In the Worksheet menu, you'll find options to format the entire worksheet, including background
color, borders, and worksheet title. You can also adjust the worksheet size.
3. Dashboard Menu:
If you're working with dashboards, the Dashboard menu allows you to format the entire
dashboard layout, including background, size, and title.
Week 6: Structuring your data, Sorting and filtering Tableau data, Pivoting
Tableau data.
Aim:- Structuring your data, Sorting and filtering Tableau data, Pivoting Tableau data.
Solution:- Creating Sorting and filtering Tableau data, Pivoting Tableau data:
Tableau supports connecting to a wide variety of data, stored in a variety of places. For example,
data might be stored on computer in a spread sheet or a text file, or in a big data, relational, or
cube (multidimensional) database on a server in enterprise or the data can be from a public
domain available on the web. Data can be imported in Tableau Public from Connect panel on left
side. For example, an Excel sample data set was loaded into Tableau as follows:
The data store page appears as above. The left pan shows that above dataset consists of 3
worksheets. If we drag orders table, screen appears as follows: Tableau automatically identifies
the data type of each column.
Now drag Returns table onto the Canvas to the right of Orders table. This shows the relation
between the two tables Orders and Returns.
If we click on the link between Orders and Returns table names at the top gives the summary of
the relationship between the tables. Now rename the data store and click on Sheet1 at the bottom
left to proceed. This step creates a data extract which improves query performance.