Pivot Tables- SQL Alias' & Field Lists

M

Marcotte A

I have two questions about Pivot Tables. To generate these pivot tables, I
am querying an Informix Database through an ODBC link. I'm using Excel 2003
and Windows XP SP3.

1) I'm querying the database for sales data for a customer that has
multiple regions. I made the query for the SOCA region and made my pivot
table with no problems. When I click on the drop down to select specific
stores I only see stores in the SOCA region (which is what I want). I then
made a copy of the worksheet the pivot table is on and edited the query so
that it only returns NOCA region info. However, when I go to select
individual stores in the pivot table, I see ALL the stores, not just NOCA
region stores. I see stores from SOCA region, as well as SDAZ, NW and TX
regions.

How can I get the drop down to only show stores that were returned by the
query. (If I select an SDAZ store on the NOCA pivot Table, I get no data.)

2) The field names in the database are not very intuitive. How can add
alias field names to my SQL query so that the fields displayed on the pivot
table have user-friendly titles? I have tried:
SELECT invhis.inhcid as Customer, ....
SELECT invhis.inhcid as 'Customer', ....
SELECT invhis.inhcid as "Customer", ....
SELECT invhis.inhcid Customer, ....
SELECT invhis.inhcid 'Customer', ....
SELECT invhis.inhcid "Customer", ....
but all of these return a syntax error. Is there another syntax that works?
 
M

Marcotte A

I have figured out the answer to question 1. Apparently, when you copy a
pivot table to a new worksheet, it "remembers" all the field values it ever
had, even if you change the criteria of the underlying query.

I'm still looking for an answer to question 2, if anyone can help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top