Re: Crosstab-force rows



For instance, you want sales of grapes, apples and oranges.

Grapes 500
Apples 400
Oranges 300

but last week, you sold no apples. You get

Grapes 500
Oranges 300

You WANT
Grapes 500
Apples 0
Oranges 300

When I have done it, I have created a dummy record for each fruit, with a bizzare date, like 1/1/2095, and a count of zero.

Then in addition to all of my criteria, (pulled from a select form or some such, on a seperate Criteria line I put that date.

This guarentees the query will find the dummy record, giving you your row even if there were no sales that week, and the zero does not otherwise efect your sums. You have to make sure that your Dummy selector, like the bizzzare date, is not part of a group by.

Ugly, but it works. Maybe someone will have something prettier.






WSC wrote:
I have a crosstab set up but when the criteria doesnt match, it doesnt pull in any data which is correct. However, i would like to show zeroes instead of blanks. How can I force the zeroes to show in the results?

I tried doing if statements in all the fields that if it = "", then put 0, but that didnt work.

thanks!
.



Relevant Pages

  • Re: Conditional countif
    ... even one occurrence of apples or grapes in column A, ... occurrences of oranges in B. So Jim in A, ... What if I wanted to add grapes in column A along ... >>> Andy. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Wish me luck
    ... > One thing I'd advise is keep fruit around the house (I especially liked ... > oranges, grapes, and apples) to munch on, rather than the higher-calorie ...
    (sci.med.transcription)
  • Re: Conditional Countif
    ... oranges or pears, then the condition is met and it should reflect 1. ... >> It appears all of the solutions work ... ... >>> even one occurrence of apples or grapes in column A, ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Conditional Countif
    ... either apples and/or grapes I would like them to be counted only if oranges or pears are in the same row in column B. i.e., A5=apples or grapes and B5= oranges or pears, then the condition is met and it should reflect 1. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Foods that arent as good as they used to be
    ... No grapes today are worth even looking at. ... and apples and kiwifruit. ... Don't get me on the subject of exports. ... trying to plug it as a better fruit but to my taste it isn't. ...
    (rec.food.cooking)