Results 1 to 5 of 5
  1. #1
    ajblue is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    3

    How do I calculate % change of invoice amounts from 2011 to 2012?

    I am a newbie in using MS Access and I would like to ask help on how to create a query showing the % change in Invoice Amounts. I want to see all ‘Suppliers’ that had year over year change of 20% or more in invoices ($) for any given month.


    I have a main table that contains the following columns: ID, Supplier, Invoice Date, Invoice Amount.

    I want to create a query with this input:
    ID Supplier Month 2011($) 2012($) Change
    1 BBB111 January $10,000 $20,000 50%
    2 AAA222 March $25,000 $40,000 37.5%

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Try a crosstab query to get the years in columns. Then use crosstab as RecordSource for report and calculate the percent in textbox.

    TRANSFORM Sum(Table1.[InvoiceAmount]) AS [Total Of InvoiceAmount]
    SELECT Table1.[Supplier], Month([InvoiceDate]) AS MonNum, Format([InvoiceDate],"mmmm") AS MonName
    FROM Table1
    GROUP BY Table1.[Supplier], Month([InvoiceDate]), Format([InvoiceDate],"mmmm")
    PIVOT Year([InvoiceDate]);

    Problem with report based on crosstab as that crosstabs are so dynamic, especially when aggregating by date criteria. Building report to be stable from period to period is not easy.
    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
    ajblue is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    3
    Thanks June7 for helping on creating the query. But how do I use crosstab as RecordSource for report and calculate the percent in textbox? I'm so sorry, I'm very new on this.

  4. #4
    ajblue is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    3
    Owww... I already got the percent change in the report However, how do I set the criteria so that I can only see % change of over 20%?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I think the report RecordSource will have to be a SELECT query that uses the crosstab as data source, something like:

    SELECT *, ([2012]-[2011])/[2011] * 100 As [PctChange] FROM crosstabquery WHERE ([2012]-[2011])/[2011] * 100 > 20;
    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.

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

Similar Threads

  1. Replies: 4
    Last Post: 07-27-2012, 02:37 PM
  2. Replies: 1
    Last Post: 07-11-2012, 07:16 PM
  3. Access Query Issue with 2012 dates
    By gtrudel in forum Access
    Replies: 2
    Last Post: 04-16-2012, 05:35 PM
  4. Navy PFA(PRT) 2011
    By BusDriver3 in forum Access
    Replies: 8
    Last Post: 08-16-2011, 06:57 AM
  5. Quarterly Amounts
    By Brian62 in forum Queries
    Replies: 9
    Last Post: 10-16-2009, 02:18 PM

Tags for this Thread

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