Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2013
    Posts
    16

    Report creating in Access by Grouping

    Hello All,
    I need to create a Group Report and subtract values from a field between two different years

    example value for Jan 2013 subtracted from Value of Jan 2014 i have attached database and the PDF file how I need output.

    Please help me to achieve this result.

    thank you in advance

    Regards,
    Saleem
    Attached Thumbnails Attached Thumbnails test_surb.jpg  
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Having a record pull value from another record in same dataset is not easy in query. Requires nested subquery or domain aggregate function. Review: http://allenbrowne.com/subquery-01.html#AnotherRecord

    However, textbox on report has a RunningSum property that might accomplish what you want. Nope, just tested.

    Will this report always have only 2 years data?

    Instead build groups in report for jobno and PUB_apsv_name.

    Expression in textbox in PUB_apsv_name footer:

    =Sum([Jan]*IIf([Year]=2013,-1,1))

    Problem with this is will have to modify the report every year to change every textbox expression. Have a form with unbound control for entry of the first year. Textbox named tbxYear in report header can reference the form:

    =[Forms]![formname]![controlname]

    Then the report expression:

    =Sum([Jan]*IIf([Year]=[tbxYear],-1,1))

    Ooops, that expression is not working. Access doesn't find tbxYear. Odd. Thought sure done this before.
    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
    Join Date
    Jul 2013
    Posts
    16
    Thanks lot... my issue related to subtracting value of 2013 from 2014 resolved with your expression =Sum([Jan]*IIf([Year]=2013,-1,1))
    Now I could not figure out how to get the percentage of subtracted value divided by value of 2013 multiply by 100
    example from my report image last total column last record 444/1175*100 =38%
    444 is the subtracted value 1175 value of year 2013
    Please help me on this...

    Thanks in Advance

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Name the textbox with difference calc like tbxDiff.

    Try:

    =[tbxDiff]/Sum(IIf([Year]=2013,[Jan],0))*100
    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.

  5. #5
    Join Date
    Jul 2013
    Posts
    16
    Thanks @ june7

    My issue resolved by solution you provided. Million Thanks

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

Similar Threads

  1. Grouping on Report
    By Amber in forum Reports
    Replies: 3
    Last Post: 02-01-2012, 05:48 PM
  2. Creating Summary Page in Access Report
    By jakeman in forum Reports
    Replies: 5
    Last Post: 10-11-2011, 06:25 PM
  3. Grouping dual keys in Access 2007 Report
    By bengineer in forum Reports
    Replies: 4
    Last Post: 02-01-2011, 02:09 PM
  4. Creating a Grouping query
    By Dev in forum Access
    Replies: 4
    Last Post: 09-02-2010, 06:46 AM
  5. Access report with 3 tables -grouping,sorting
    By kartechy in forum Reports
    Replies: 0
    Last Post: 07-22-2009, 09:07 AM

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