I have a cross tab query with Date as a row heading and a series of Names as column headings. The Value for each Date/Name intersection can either be -1, 0 or 1.
For example:
I would like to have a column ("Members") that counts the non-zero values for each row. This would give something like the following:
I am having trouble using the count function to achieve this. In the cross tab query builder I am defining the following, where "Value" is the field that holds either a -1, 0 or 1.
But this always returns the count of all of the names. So in the above example I get the following:
as there are four names. For the first row it would ideally return 3, followed by 2 in the second row.
I would appreciate any help you all can give me on this one.
For example:
Code:
Date, Name1, Name2, Name3, Name4 1/1/2000, -1, -1, 0, 1 1/2/2000, 1, 1, 0, 0
Code:
Date, Members, Name1, Name2, Name3, Name4 1/1/2000, 3, -1, -1, 0, 1 1/2/2000, 2, 1, 1, 0, 0
Code:
Field: Members: Count([Value]<>0) Table: <this is blank> Total: Expression Crosstab: Row Heading Criteria: <this is blank>
Code:
Date, Members, Name1, Name2, Name3, Name4 1/1/2000, 4, -1, -1, 0, 1 1/2/2000, 4, 1, 1, 0, 0
I would appreciate any help you all can give me on this one.
Comment