DWFile
DWFile
&
DATA MINING
PRACTICAL FILE
INDEX
The first Excel function you should be familiar with is the one that performs the basic arithmetic
operation of addition:
In the syntax of all Excel functions, an argument enclosed in [square brackets] is optional, other
arguments are required. Meaning, your Sum formula should include at least 1 number,
reference to a cell or a range of cells. For example:
If necessary, you can perform other calculations within a single formula, for example, add up
values in cells B2 through B6, and then divide the sum by 5:
=SUM (B2:B6)/5
To sum with conditions, use the SUMIF function: in the 1st argument, you enter the range of
cells to be tested against the criteria (A2:A6), in the 2nd argument - the criteria itself (D2), and
in the last argument - the cells to sum (B2:B6):
AVERAGE:
The Excel AVERAGE function does exactly what its name suggests, i.e. finds an average, or
arithmetic mean, of numbers. Its syntax is similar to SUM's:
Having a closer look at the formula from the previous section (=SUM (B2:B6)/5), what does
it actually do? Sums values in cells B2 through B6, and then divides the result by 5. And what
do you call adding up a group of numbers and then dividing the sum by the count of those
numbers? Yep, an average!
The Excel AVERAGE function performs these calculations behind the scenes. So, instead of
dividing sum by count, you can simply put this formula in a cell:
=AVERAGE (B2:B6)
To average cells based on condition, use the following AVERAGEIF formula, where A2:A6
is the criteria range, D3 is he criteria, and B2:B6 are the cells to average:
The MAX and MIN formulas in Excel get the largest and smallest value in a set of numbers,
respectively. For our sample data set, the formulas will be as simple as:
=MAX (B2:B6)
=MIN (B2:B6)
If you are curious to know how many cells in a given range contain numeric values (numbers
or dates), don't waste your time counting them by hand. The Excel COUNT function will bring
you the count in a heartbeat:
While the COUNT function deals only with those cells that contain numbers, the COUNTA
function counts all cells that are not blank, whether they contain numbers, dates, times, text,
logical values of TRUE and FALSE, errors or empty text strings (""):
IF
Judging by the number of IF-related comments on our blog, it's the most popular function in
Excel. In simple terms, you use an IF formula to ask Excel to test a certain condition and return
one value or perform one calculation if the condition is met, and another value or calculation
if the condition is not met:
For example, the following IF statement checks if the order is completed (i.e. there is a value
in column C) or not. To test if a cell is not blank, you use the "not equal to" operator (<>) in
combination with an empty string (""). As the result, if cell C2 is not empty, the formula returns
"Yes", otherwise "No":
AND & OR
These are the two most popular logical functions to check multiple criteria. The difference is
how they do this:
While rarely used on their own, these functions come in very handy as part of bigger formulas.
For example, to check the test results in columns B and C and return "Pass" if both are greater
than 60, "Fail" otherwise, use the following IF formula with an embedded AND statement:
=IF(AND(B2>60, B2>60), "Pass", "Fail")
Experiment 4: To make olap cube in MS Excel
OLAP implement the multidimensional analysis of business information and support the
capability for complex estimations, trend analysis, and sophisticated data modelling. It is
rapidly enhancing the essential foundation for Intelligent Solutions containing Business
Performance Management, Planning, Budgeting, Forecasting, Financial Documenting,
Analysis, Simulation-Models, Knowledge Discovery, and Data Warehouses Reporting. OLAP
enables end-clients to perform ad hoc analysis of record in multiple dimensions, providing the
insight and understanding they require for better decision making.
• Copy the data from the above table and copy into another worksheet.
• Now Select anywhere in the table and go to Insert tab and click Pivot table, you can
also check for the recommended pivot table.
• Now create three pivot tables according to your data.
• Select the fields and add the content in row, table or values column and add filter to it.
• The three pivot tables here are: Product Category by Year Quarters, Year quarters by
sections and by count of sections.
• Now close the grand total of all the three tables.
• Now to remove the drop down select any cell type (=cell number) and Enter.
• Drag and format the values, update all three pivot in the same way.
• Cut these new tables and paste into another worksheet, now change the borders and the
cell colour from cell formatting.
• Copy the tables and paste as picture in the same sheet and change their rotations.
• Arrange them in a way to form a cube as shown below.
OUTPUT:
Experiment 5: To create a table in MS Access
Microsoft Access is a Database Management System (DBMS) from Microsoft that
combines the relational Microsoft Jet Database Engine with a graphical user interface and
software development tools. It is a part of the Microsoft Office suite of applications,
included in the professional and higher editions. This is an introductory tutorial that covers
the basics of MS Access.
Steps to create a simple table:
• Open MS Access and you will see the following screen in which different Access
database templates are displayed.
• Select a blank database and Access will create a new blank database and will open
up the table which is also completely blank.
• Now click on create button & then a screen appears showing id and field name.
• Now click on design table then screen appears showing field name, data type &
description.
• Where data type is the form in which input taken & field name is column name.
• Make one entry as a private key, by selecting the primary key option.
• Choose the field name and their respective data type.
• Click ok and a blank database appears
• Bound forms: Bound forms are connected to some underlying data source such as a
table, query, or SQL statement.
• Unbound forms: These forms are not connected to an underlying record or data source.
• Open your database and go to Create tab and click on The Form Wizard option
• You can change the Form view to enter the records from Home tab from left upper
corner.
Designing the Form
• Go to create tab & click on Form wizard and then following screen appears.
• Now select the fields to show on the form by clicking on >> button.
• Otherwise if you don’t need any one of field from selected field click on < button.
• Now click on next
• Then the following screen appears where you can select which type of form you want
to make. We will select columnar and click on next.
• Now a screen appears through which you can change the name of the form and select
the Modify the form’s Design radio button to modify the form and click on finish
Design View:
• To change the background colour of boxes or text select the boxes and by right clicking
you will get various options for styling and colouring the boxes and text.
• To add buttons to your form, go to Design tab and click on Button tool & then you can
draw your button anywhere in the design area. Now following Common Button Wizard
Screen appears.
• From this screen you can select which type of buttons you want to add. Now we select
Record Operations and in right side we select Add New Record & then click on Next
button. Then following screen appears.
• This will ask for name of button or to put an image in place of button and click on
finish.
• Similarly, we can add different buttons like Save Record, Last Record, First Record,
Next Record & Previous record.
• Now you can add a chart also by clicking on chart button from design tab.
• Now you can finally view your form by clicking on Form View from Home Tab.
All Access Obje..
P project
Experiment-7: To create various type of queries in MS Access database.
Query: A query is a request for information from the database tables. Simple queries are those
that retrieve data from a single table.
Steps involved to use various type of queries:
• First we add up a Salary column in our EmpTable by using Design view of table. Now
the table used for applying queries is given below.
• To start querying go to Create tab and click on the Query Wizard. Now the following
screen appears
• Now select Simple Query Wizard and click OK. Then following screen appears. In this
step you can choose table in which you have to apply queries. And you can also choose
fields on which you have to apply queries using >> button. We will select all fields to
right side and click on Next. Then following screen appears.
• In this step you can change the name of the query & we will select Modify the Query
Design and click on Finish. Now the following screen appears
• So in above screen various columns appears. In row named Criteria we can write our
queries. E.g. if we want to get the names of the employees whose name starts with letter
M, we can write our query in First Name Col.
• MS Access engine automatically convert written query into its defined syntax. Like
“V*”
• To execute above query go to Design Tab & clickon Run Button.
• To make a query for Salary column, let us suppose we have to find out which employees
have pay greater than 20,000. Now go to pay column and we will write our query in
Criteria row.
• Query: >= 20000
• If you want to add extra column specifying an expression to find anything e.g. Bonus.
We will go to Design Tab and click on the Builder. Then following screen appears.
• In this screen we can write the name of the column and note that the name of the column
should be exceeded by: e.g. Bonus: and afterthatif you want to add any name of column
than it should be in [] e.g. [pay] Expression for Bonus: Bonus: ([Pay]*50) And then
click on OK. Now you can see a column is added to table column.
• To execute above query, go to Design Tab & click on Run Button.
Experiment-8: To Create a MS Access Report of Access Database.
Reports offer a way to view, format, and summarize the information in your Microsoft Access
database. For example, you can create a simple report of phone numbers for all your contacts,
or a summary report on the total sales across different regions and time periods
• A report consists of information that is pulled from tables or queries, as well as
information that is stored with the report design, such as labels, headings, and graphics.
• The tables or queries that provide the underlying data are also known as the report's
record source.
• If the fields that you want to include all exist in a single table, use that table as the
record source.
• If the fields are contained in more than one table, you need to use one or more queries
as the record source.
You can:
• Create a Simple Report
• Create A grouped or summary report
• Design Reports
• Use Sub reports
• Use query as the record source for a form report
• Modify edit or change report
• Set record source for report
• Summing
• Counting
Steps:
You can use a query to supply data to a form or report in Access. You can use a query when
you create the form or report, or you can change an existing form or report by setting its Record
Source property. When you set the Record Source property, you can either specify an existing
query, or you can create a new query to use.
Create a simple report, by going to create tab and clicking on Report:
In Design view, set the Record Source property to an existing query that you want to use.
1. Open the form or report in Design view. If the property sheet is not already open,
press F4 to open it.
2. In the property sheet, on the Data tab, click the Record Source property box.
OR
2. Click the arrow and then select the query that you want to use.