Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to retreive data according to date constrain

Posted on 2014-09-03
5
Medium Priority
?
147 Views
Last Modified: 2014-09-05
I am connecting Excel to SQL Server to create some reports by using the data from SQL.. Example of data in SQL is Table name: Campaign that include (AccountID, date, impressions, clicks, cost). I would like to create a report in Excel that keep historical record for each week just like the one in the picture how i want my report to look like.. is there any way that allow me to pull data from SQL in weekly bases ?

Thank you!
0
Comment
Question by:Rawan Jambi
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:jkpieterse
ID: 40301185
Click the Data tab of the ribbon, click "From other sources", "from SQL server" and off you go!
0
 

Author Comment

by:Rawan Jambi
ID: 40301220
yes I know I am doing this already.. my question is when getting the data how can I make them come as blocks for weeks? for example (1 july - 7 july ) with their data (accounted, impressions, clicks and cost) then (8 july - 15 july) then the next week ... etc
0
 
LVL 11

Expert Comment

by:jkpieterse
ID: 40301257
You would typically create a pivottable off of the data, drag the date field in the row area and then group that date field.
0
 
LVL 16

Accepted Solution

by:
Jerry Paladino earned 2000 total points
ID: 40303597
Use your detail data to generate a pivot table.   Insert / Pivot Table...   Group the Date field... right mouse click on that field and select GROUP.   For Weeks, select Day and choose 7 in the number of days box.   Use "Calculated Fields" for Cost per Click and Click Through Rate.  Pivot Table / Analyze / Calculations group / Fields, Items, & Sets.  See graphics below.   A sample excel file is attached. GroupingGroup by WeekCalculated Field Dialog selectionCalculated Field - Cost per ClickCalculated Field - Click Through RatePivot-Table--Group-by-Week.xlsx
0
 

Author Comment

by:Rawan Jambi
ID: 40305603
Thank you so much that was very helpful.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question