I am pulling my hair out on this one. How do you get unique values in a crosstab query? I've tried using DISTINCT and DISTINCTROW to no avail. I always get record count, and not unique.
In short, I have a table with about 30 fields ranging from CustomerID, CustomerSize, Geo, etc.....and of course product purchased, $.
What I want to do is create a crosstab query where the rows are CustomerSize, and Geo, the column is based on FY, and the value is a UNIQUE COUNT of the Customer IDs. Instead what I get is the number of records for that customer within those guidelines. Since many customers purchase throuought the year, this obviously throws the counts way off. Now I have to export to Excel and run a different function on an array to get unique values. Some of the tables are greater than 100K records and this takes some time.
Why am I having so much trouble with this?
2006 2007 2008
Large NA 5 8 10
Large EMEA 4 6 3
Large APAC 7 8 23
Medium NA 0 5 3
Medium EMEA 3 2 7
Medium APAC 4 6 8
etc...
Any help would be greatly appreciated and I will sing your praises to everyone whether they want to hear them or not!!!
In short, I have a table with about 30 fields ranging from CustomerID, CustomerSize, Geo, etc.....and of course product purchased, $.
What I want to do is create a crosstab query where the rows are CustomerSize, and Geo, the column is based on FY, and the value is a UNIQUE COUNT of the Customer IDs. Instead what I get is the number of records for that customer within those guidelines. Since many customers purchase throuought the year, this obviously throws the counts way off. Now I have to export to Excel and run a different function on an array to get unique values. Some of the tables are greater than 100K records and this takes some time.
Why am I having so much trouble with this?
2006 2007 2008
Large NA 5 8 10
Large EMEA 4 6 3
Large APAC 7 8 23
Medium NA 0 5 3
Medium EMEA 3 2 7
Medium APAC 4 6 8
etc...
Any help would be greatly appreciated and I will sing your praises to everyone whether they want to hear them or not!!!
