Results 1 to 3 of 3
  1. #1
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7

    Lightbulb Pivot table count only

    Hi,

    I have a database that collects downtime event information. I have several querries that calcualte the downtime and availability. These are then combined into one querry using union querry. In the union querry I use the NZ function to replace any null values for 100. I end up getting a short set of data for 7 day moving report:
    Expr1000 Day1
    39.58 23/01/2013
    83.33 22/01/2013
    100 21/01/2013
    100 20/01/2013
    58.33 19/01/2013
    100 18/01/2013

    I need to display this data in a line chart. I'm using pivot table with dates at the bottom and values on the vertical axis. However, the only option that comes up for the calculation in the pivot chart is Count. All the other ones are grayed out. I need to use the Sum.

    I have tried to use another querry to collect the data and put it in a table, but the pivot chart behaved the same as through the querry.. I tired to remove the NZ statements form my union querry, which worked but gave undesired result, i.e. if there are not entries for a particular day, I need to have value of 100 not null. No entries means 100% availablity.



    Here is my union querry text.

    Code:
    Select NZ([Day1Av],100), [Day1]
    From [Daily Availability for Daily report 1 - Crush]
    UNION ALL SELECT NZ([Day2Av],100), [Day2]
    From [Daily Availability for Daily report 2 - Crush]
    UNION ALL SELECT NZ([Day3Av],100), [Day3]
    From [Daily Availability for Daily report 3 - Crush]
    UNION ALL SELECT NZ([Day4Av],100), [Day4]
    From [Daily Availability for Daily report 4 - Crush]
    UNION ALL SELECT NZ([Day5Av],100), [Day5]
    From [Daily Availability for Daily report 5 - Crush]
    UNION ALL SELECT NZ([Day6Av],100), [Day6]
    From [Daily Availability for Daily report 6 - Crush]
    UNION ALL SELECT NZ([Day7Av],100), [Day7]
    From [Daily Availability for Daily report 7 - Crush];
    Can someone please assit me and advice me on what am I doing wrong? Why is it the NZ function causes the pivot chart to remove the other calculation options? I've tried searching everywhere, but this seems to be a rather unique problem. I appreciate all help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I think Nz function actually results in a string value, even only numerals are in the result.

    Need alias fieldname defined on the first line.

    Try converting to number with Val():

    SELECT Val(NZ([Day1Av],100)) As Avg, [Day1] FROM
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7
    Thanks that has worked. I would not have thought of that.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pivot table - Input
    By Aviram in forum Forms
    Replies: 5
    Last Post: 09-18-2012, 02:52 PM
  2. Pivot Table Format
    By TPH in forum Access
    Replies: 1
    Last Post: 01-03-2012, 11:59 AM
  3. Pivot table problems...
    By netserf in forum Access
    Replies: 1
    Last Post: 08-22-2010, 11:43 AM
  4. Exporting pivot table
    By nesbtech in forum Import/Export Data
    Replies: 1
    Last Post: 04-28-2008, 12:19 PM
  5. Pivot Table Problem
    By larpup in forum Forms
    Replies: 0
    Last Post: 01-06-2006, 08:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums