Consulting

Results 1 to 5 of 5

Thread: AutoCalc - Pivot Charts - difference between Table and Query

  1. #1

    AutoCalc - Pivot Charts - difference between Table and Query

    This refers to my earlier post on the "AutoCalc option grayed out ...".

    I am experimenting with different scenarios. I want to point out that I am having this problem working with a query with calculated fields from a table, which forms the input data.

    When I work with the table itself (containing the input data), in the Pivot Chart view, I am able to view all the options in the AutoCalc menu. I can choose Average or Sum or Max etc.

    This is strange. The option for a query based on this table is only Count.

    Has anyone noticed a similar problem?

    Once a Pivot chart is created, the Legend options seem to be limited. For example, I cannot change the orientation of the Axis titles, insert values for the bars at their tips etc.

    - Krishna

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Krishna, I think it depends on the Type of fields that you select for inclusion. ie if you select only Values it allows arithmetic functions, but if you include text it only allows count.
    Have you considered using a Query with Totals or a Crosstab Query with a Graph Form?

  3. #3
    OBP, that is a good point.

    In my query, I am using a function to calculate the result. As I want to get a blank cell (instead of 0) if the input data is not entered, I am using vbNull. The function is as following:

    [VBA]
    'Find the Trips per Prime Mover
    Function NumTrips(Trips As Variant, pmer As Variant) As Variant
    On Error GoTo NextStep
    If ((IsNumeric(Trips) = False) Or (IsNumeric(pmer) = False) Or (pmer = 0)) Then
    NumTrips = vbNull
    Else
    NumTrips = (Trips / pmer)
    NumTrips = Format(NumTrips, "#,###.000")
    End If
    NextStep:
    If (ErrNumber <> 0) Then
    Exit Function
    End If
    End Function
    [/VBA]

    Could this be causing the problem?

    I do not want a 0 to appear in the query results for a non-entry in the input data table. Leaving the cell blank will not count it for calculating the Average value of a range of results.

    -Krishna

  4. #4
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Krishna, can you exclude Non entries all together by using a pre-query?

  5. #5
    How do I do that? Will you pl elaborate?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •