+ Reply to Thread
Results 1 to 30 of 30

Excel MI Reporting Query

  1. #1
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Thumbs up Excel MI Reporting Query

    Hi,

    I'm a bit of a novice in Excel and have a requirement for which I don't know the best approach.

    PC ID Application Signed Off Username
    001 app1 Yes A B
    001 app2 Yes A B
    002 app1 Yes A C
    002 app2 Yes A C
    003 app1 Yes A D
    003 app3 No A D
    004 app4 No A E
    005 app5 No A F

    I need to produce some MI that tells me which PC IDs are ready and which are not ready based on all of the applications it has being signed off. Column 3 is manually updated as applications are signed off so the results I would expect from the above would be:

    PC ID Signed Off Username
    001 Yes A B
    002 Yes A C

    I'm unsure of the best way of achieving this. In my master spreadsheet some of the PC IDs have over 400 apps so simply filtering the columns is simply not possible. The key output also is only to know which PCs have had all of the applications assigned to it signed off. Hopefully this makes some sense......any help would be much appreciated.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Excel MI Reporting Query

    I would go for two tools (both from Data ribbon):
    1) Advanced Filter (to copy only data with Signed = Yes)
    then remove column with ID Application
    2) Remove Duplicates


    Assuming your data is in columns A:D write in F1:
    Signed
    and in F2
    Yes

    and run the macro which dows the above actions:
    Sub test()
    Please Login or Register  to view this content.
    See attachement book1.xls

  3. #3
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,

    Thanks for the info, nearly what I was looking for......I have just run the macro and it has output results for PC 001, 002 & 003. I only need to display the PC IDs where all of the applications are marked as signed off. As PC ID 003 has 2 applications, 1 which is signed off and 1 which isn't, I wouldnt expect to see this in the list.

    Is there anyway to ensure that we filter only on PCs with all apps signed off?

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Hi,

    This is my solution and its more like a database querying using SQL statements. I have also attached a sample data file in line with the way you have described.

    You can try selecting the actual file from the select button and i presume, that the sheet that has the data is called "Sheet1", if not we need to replace the word Sheet1 with the actual sheet name in the sql statement.
    Attached Files Attached Files
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  5. #5
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi......thanks very much, this has give me exactly what I need.

    Thanks for your help.

  6. #6
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    You are welcome. Glad i could help.

  7. #7
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Please mark this thread as solved, if you are happy with the solution provided.

  8. #8
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Just one question.......I have additional columns in the master spreadsheet. If I wanted to incldue these in the query results how do I add them into the query?

  9. #9
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Hi,

    this is the sql statement :

    Please Login or Register  to view this content.
    Let us assume that you have a field Department, this would be added in these 2 places :

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,
    I have copied in as:
    select a.[PC ID], [USERNAME] , [TEST] COUNT(a.[APPLICATION]) AS APP_COUNT, ( SELECT COUNT(application) FROM [SHEET1$] WHERE [SIGNED OFF] ='Yes' and [pc id] = a.[pc id] ) as Signed FROM [SHEET1$] a GROUP BY [PC ID],[USERNAME] , [TEST] having COUNT(a.[APPLICATION]) = ( SELECT COUNT(application) FROM [SHEET1$] WHERE [SIGNED OFF] ='Yes' and [pc id] = a.[pc id])

    But when run I get the error 'Syntax error (missing operator) in query expression '[TEST] COUNT(a.[Application]).

    Any ideas?

  11. #11
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Hi,

    You need to put a comma after [TEST] AND COUNT(a.[APPLICATION]) AS APP_COUNT like this :

    Please Login or Register  to view this content.
    rest everything seems fine.
    Last edited by xlbiznes; 12-16-2013 at 10:49 AM.

  12. #12
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,

    Thanks....I managed to work out how to add columns at the start of the worksheet but not after! The columns in order are as follows:

    "PC ID" "Application" "Signed off" "PC or laptop" "user name" "HWbldng_sc" "Directorate"
    "Division" "Branch" "Room" "Site"

  13. #13
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    try this,

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi thats perfect thanks........may have hit a bit of a snag though!

    I tested this on a section of the data (500 records) and it worked instantly, however the workbook has 25,000 records and when attempted with this many records it crashes! Is there anyway of speeding it up or do I just need to chop the data into manageable chunks?

  15. #15
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    it should work fine for even 25,000 records. As i normally use this with files with more than 50,000 records.

  16. #16
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    One more thing, when you run such queries with row intensive files it might freeze up ,but will get back after the query has finished processing.

  17. #17
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,

    Just run the query on a test set of data and unfortunately it doesnt seem to be working. I have kept in 2 example sets of users in the attached to show you.

    The query picks up both of these users in the results however as you can see from the listeach user also has lots of other applications that are not ready. The requirement for the query is only to output users that have all of their apps signed off. Any ideas why this is?
    Attached Files Attached Files
    Last edited by N.Lamech; 12-17-2013 at 10:11 AM.

  18. #18
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Looking into this right now.

  19. #19
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Hi,

    when i run the query on the master.xlsx file that you have posted, no records are displayed for the condition of fully signed off.

    am i missing something here ?

  20. #20
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,
    I think it may be an issue with the source data. When I run it with the source data it doesn't work however with the dummy data I provided it works!

    met me try and find an example of where it doesnt work

  21. #21
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,

    I think I understand where the issue is. If you run the query on the attached data it should output the result as a record even though only 1 of the 3 applications is marked as 'Yes'. However when I change the column F so that the location is the same for all 3 records the query doesn't output the record. It seems like the query is verifying the data across multiple fields whereas these fields will in most cases be different.

    Is it possible to run the query so that it only pulls up results where Column C = Yes for all applications in column b per unique user as defined in Column A!

    Hope that makes sense.
    Attached Files Attached Files

  22. #22
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    We can do a work around by taking the max for the dimension columns like building, site,HWbldng_sc . Is that ok

  23. #23
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Can you try this sql statement :


    Please Login or Register  to view this content.

  24. #24
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Thanks......I'll give that a go now although it still takes a long time to run. It outputs the correct results if I delete all of the data apart from what is in Col A Col B and Col C so will check the results against that number.

  25. #25
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    I hope we are able to get to the output that you have been trying to get so far.

  26. #26
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Using the new SQL statement against all the data I receive 1390 results.

    Using the old SQL statement and deleting all data apart from Col A-C I get 718 result so there is still a mismatch.

    Does the new SQL statement allow for different usernames per PC ID as this is the case sometimes?

  27. #27
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    using the last sql statement , it expects that [pc id],[pc or laptop],[user name] will not change for a give pc id.

    If the user name is going to vary then use this sql

    Please Login or Register  to view this content.

  28. #28
    Registered User
    Join Date
    12-16-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Excel MI Reporting Query

    Hi,

    718 for both now.....think we finally got there thanks very much for all your help.......much appreciated

  29. #29
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    Finally,

    You are welcome. Glad i could help.

  30. #30
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Excel MI Reporting Query

    I you are satisfied with the solution provided, please mark this thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Sorting and reporting - Probably a VLookup query
    By dvs in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-24-2013, 01:14 AM
  2. VBA, Excel and Reporting
    By Bezzie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2012, 03:04 AM
  3. Excel reporting
    By kalyanverma in forum Excel General
    Replies: 9
    Last Post: 07-26-2011, 06:19 PM
  4. Excel query in SQL Server 2008 reporting services
    By venkatperi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2010, 12:41 PM
  5. Automate Reporting Excel
    By smylod in forum Excel General
    Replies: 1
    Last Post: 03-02-2009, 04:51 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1