Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default interesting pivot table questing

let us consider the following access table
mod Region rev qty
020 china 20 10
023 india 30 10
020 japan 40 8
020 china 10 2
(database table)

, and we define the query: SELECT [mod], Region, Sum
(rev) AS srev, Sum(qty) AS sqty, srev/sqty AS cru
FROM Table1 GROUP BY [mod], Region; we then use the pivot
table to get CRU , we get the following pivot table result:
region:(All)
mod 020
Data
sum of srev sum of sqty sum of CRU
total 70 20 7.5



the cru is 7.5, which is not correct, if we defined a
calculated item called CRU(srev/sqty), then the cru is
3.5, which is
correct. However, if we define the region to be china, the
result returned by pivot table using database query is
correct. and can be seen as follows in pivot table :
region:(All)
mod 020
Data
sum of srev sum of sqty sum of CRU
total 30 12 2.5

The reason is that CRU can't be aggregated. so how to
design the datbase query in the pivot table, when user
aggragates region, mod or
whatever, we can still return the cru correctly.
..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default interesting pivot table questing

Why not point your pivot table straight at the table and
use a calculated field in the pivot?
cheers
Simon

-----Original Message-----
let us consider the following access table
mod Region rev qty
020 china 20 10
023 india 30 10
020 japan 40 8
020 china 10 2
(database table)

, and we define the query: SELECT [mod], Region, Sum
(rev) AS srev, Sum(qty) AS sqty, srev/sqty AS cru
FROM Table1 GROUP BY [mod], Region; we then use the pivot
table to get CRU , we get the following pivot table

result:
region:(All)
mod 020
Data
sum of srev sum of sqty sum of CRU
total 70 20 7.5



the cru is 7.5, which is not correct, if we defined a
calculated item called CRU(srev/sqty), then the cru is
3.5, which is
correct. However, if we define the region to be china,

the
result returned by pivot table using database query is
correct. and can be seen as follows in pivot table :
region:(All)
mod 020
Data
sum of srev sum of sqty sum of CRU
total 30 12 2.5

The reason is that CRU can't be aggregated. so how to
design the datbase query in the pivot table, when user
aggragates region, mod or
whatever, we can still return the cru correctly.
..


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
Questing regarding Date Stamp Gunti Excel Discussion (Misc queries) 2 November 25th 08 10:12 AM
Filter lines containing pivot table and non pivot table data Grover Excel Worksheet Functions 0 September 24th 07 07:20 PM
How do I create a pivot table if the pivot table icon or menu ite. Lynn@WS Charts and Charting in Excel 1 December 16th 04 02:36 AM
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" Diana[_5_] Excel Programming 0 August 21st 03 10:19 PM


All times are GMT +1. The time now is 09:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"