PC Review


Reply
Thread Tools Rate Thread

Crosstab queries, <> and null values

 
 
Edwinah63
Guest
Posts: n/a
 
      21st May 2010
Hi everyone,

I have a crosstab query attached to a graph on a report. It shows
quantity of widgets produced by each employee for a specified period.
The client wants all months shown regardless of zero widgets. If I
just use the Access graph wizard, it only shows the months when there
are some values not all months with or without zero values.

The final graph is supposed to be sum(widgets) and each bar represents
a worker.

So...

MonthSt WorkerName #Widgets
01/Jan/2010 Bob 10
01/Jan/2010 Dave 5

01/feb/2010 [null] 0


01/Mar/2010 Bob 16

01/Apr/2010 [null] 0

01/Jul/2010 Bob 1
01/Jul/2010 Dave 7

etc

Creating the crosstab based on the above data via the wizard is Ok,
but where the workername is
null, it displays "<>" on the crosstab query and consequently with its
own coloured box on the legend even
tho' there is no data for it and the bar is not shown on the graph.

Can I remove it? Or mask it or just suppress those values?

Thanks in advance

Edwinah63
 
Reply With Quote
 
 
 
 
XPS35
Guest
Posts: n/a
 
      21st May 2010
Edwinah63 wrote:

>
> Hi everyone,
>
> I have a crosstab query attached to a graph on a report. It shows
> quantity of widgets produced by each employee for a specified period.
> The client wants all months shown regardless of zero widgets. If I
> just use the Access graph wizard, it only shows the months when there
> are some values not all months with or without zero values.
>
> The final graph is supposed to be sum(widgets) and each bar represents
> a worker.
>
> So...
>
> MonthSt WorkerName #Widgets
> 01/Jan/2010 Bob 10
> 01/Jan/2010 Dave 5
>
> 01/feb/2010 [null] 0
>
>
> 01/Mar/2010 Bob 16
>
> 01/Apr/2010 [null] 0
>
> 01/Jul/2010 Bob 1
> 01/Jul/2010 Dave 7
>
> etc
>
> Creating the crosstab based on the above data via the wizard is Ok,
> but where the workername is
> null, it displays "<>" on the crosstab query and consequently with its
> own coloured box on the legend even
> tho' there is no data for it and the bar is not shown on the graph.
>
> Can I remove it? Or mask it or just suppress those values?
>
> Thanks in advance
>
> Edwinah63


You can add criteria to the crosstab query to eliminate data. The query
then could look like:

TRANSFORM Sum([#Widgets]) AS [Widgets]
SELECT MonthSt
FROM YourData
WHERE WorkerName Is Not Null
GROUP BY MonthSt
PIVOT WorkerName;

--
Groeten,

Peter
http://access.xps350.com

 
Reply With Quote
 
Edwinah63
Guest
Posts: n/a
 
      21st May 2010
Hi Peter,

I have already tried this, but the client wants all months shown
regardless of zero widgets so if I apply workername is null I lose the
zero value stuff the client wants to see.

Thanks for your reply.
 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      21st May 2010
Try using the NZ function to force a name.

TRANSFORM Sum([#Widgets]) AS [Widgets]
SELECT MonthSt
FROM YourData
GROUP BY MonthSt
PIVOT Nz(WorkerName,"No Activity");



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Edwinah63 wrote:
> Hi Peter,
>
> I have already tried this, but the client wants all months shown
> regardless of zero widgets so if I apply workername is null I lose the
> zero value stuff the client wants to see.
>
> Thanks for your reply.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crosstab Query Null Values =?Utf-8?B?VHJldmVyIEI=?= Microsoft Access Queries 7 19th Oct 2005 09:19 AM
How do I replace null values in crosstab queries? =?Utf-8?B?UGFuZGFsdXM=?= Microsoft Access Queries 1 11th Oct 2005 12:55 AM
Null values in a crosstab =?Utf-8?B?QmRhdmlz?= Microsoft Access 2 6th Apr 2005 05:10 PM
Null Values in Crosstab Queries =?Utf-8?B?U2VhbkZ1cmxvbmc=?= Microsoft Access Queries 1 21st Oct 2004 05:48 PM
In Crosstab Query If Any Values Are Null I Want Sum to Be Null mcl Microsoft Access Queries 4 27th Feb 2004 06:26 PM


Features
 

Advertising
 

Newsgroups
 


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