GeekInterview.com
Series: Subject: Topic:
Question: 1 of 31

How to create pivot table ?

Explain with an example which situation that pivot tables can save time compared to any other reporting tools available
Asked by: sachinvinaya | Member Since Nov-2009 | Asked on: Jul 19th, 2011

View all questions by sachinvinaya   View all answers by sachinvinaya

Showing Answers 1 - 1 of 1 Answers

Using Pivot Table we can view data multidimensionally. It is basically used for improved presentation of data. A Pivot Table not only summarizes data by categories but also by subcategories. One of the main advantages of Pivot Table is its ability to display trends spread over a range of categories. Using Pivot Table we can transform the placement of rows and columns. Consider we have a table which stores information such as production date, material name, material cost This table holds historical data of cost of several materials for a certain period. Now if we want to find out the total cost of each material for each and every date for all the materials at one go We can use Pivot table query also know as cross tab query

Code
  1. TRANSFORM Sum(Cost_Price) AS Cost
  2. SELECT Format([Production_Date],"yyyy-mm-dd") AS [Production Date]
  3. FROM materials_cost
  4. GROUP BY Format([Production_Date],"yyyy-mm-dd")
  5. PIVOT Material_Name;
  6.  

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.