+ Reply to Thread
Results 1 to 30 of 30

Unpivot and analyse data

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Unpivot and analyse data

    Hi I have data recorded in rows. Each row is a unique overall request but contains data from up to 3 other areas.

    I am tring to create a chart showing
    • incoming each month (req x FNs)
    • assigned each month
    • complete each month
    • assigned but not complete each month (carryover)

    the data layout is causing me a challenge, I get that I have to unpivot but I cannot create a single chart showing all the measures

    any help appreciated!

    Screenshot 2024-05-13 132341.png
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Still using Excel 2010?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    Not 2010. This is my version : Microsoft® Excel® for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    OK, so take a look at this... it's all the data re-sorted and tarted up. Can you a) explain exactly what graphs you want or b) do it yourself from here?

    Delete ALL expected results.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    Thanks Glenn

    I wasn't planning to use a formula because the data I provided here was just a representative sample, and the actual sheet contains over 6000 rows of data. Hence I was thinking unpivot through Power Query and creating chart from there.

    I may also need a date table ? since I want to analyze Logged Date , Assigned Date, and Complete Date ...

    And yes I do need some help creating a visual representation of the data


    I envisage something like this as the output (this chart is accurate for the sample data I provided in first post)

    Picture1chart.png

    thank you

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    6000 rows is nothing. A formula can do that... and 10x more easily. Test it on your real data. I'm away for the night, but will be back in the morning.
    Last edited by Glenn Kennedy; 05-14-2024 at 03:03 AM.

  7. #7
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    Will test and report back. Thanks again

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Well? I tested my formula with 10,000 rows and it took 0.3 seconds to calculate. So, AFAIK, no performance issues. HOWEVER, I am a bit baffled by your expected results.

    Please explain HOW you derived the expected results for February.

  9. #9
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    I have not successfully applied it to the real data yet as that is in different columns to the representative sample I provided here.
    My real dataset has many additional columns which are not relevant for this analysis.
    When I dropped in the formula to test, it turned the 6000 odd rows into approx 86000 which is consuming a lot of my PCs resources to process.
    So I need to figure out how to modify the formula to suit my real dataset!

    regarding how I arrived to my expected results for Feb:
    • 4 new requests = 6020 x 2 FNs, 6021, 6022
    • 5 assigned = 5695 FN1, 6022 FN1, 6020 FN2, 6021 FN2, 6020 FN3
    • 3 complete = 5695 FN1, 6021 FN2, 6020 FN3
    • 6 carryover = (4 + 5)-3 .... which is coming from 4 new requests in feb + the 5 requests assigned in Jan but not complete in Jan, - 3 complete in feb
    Last edited by devaloka; 05-14-2024 at 08:07 AM.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    iteration 2.

    i do not see how 6000 rows can be expanded into even one more more than 18,000 rows... as there are (at worst) 3 areas per row, times 6000 rows. But leave that for now.

    1. Please check the values in purple. Explain why different answers are expected (if any). Pay particular attention to the two pairs of red cells... completed, but without a date.

    2. Explain the carryover values for all months shown. I just cannot get my head around this!! My attempt to calculate manually (outside the main formula) is in yellow...
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    I think I see the source of confusion.



    Everything in purple correct except completed for March, April and May.
    I think you are counting only whether status is complete and date is date request was logged.
    I am counting whether status is complete and date is date that request was marked complete. If no complete date, not counted since completion month unknown.

    Book143 (1) (update).xlsx

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Completed is fixed. All I need to do is figure out how to get the last column incorporated dynamically into the formula... As Sherlock Holmes would have said... "a two-pipe problem".
    Attached Files Attached Files

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    I didn't even need to start smoking again... let alone smoke two pipes-worth.
    Attached Files Attached Files

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Finally... I hope... complete with graph.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    that is amazing, thank you for all your help

    unfortunately I still have some issues implementing this to my data set

    as mentioned the dataset contains many more columns which are not required for this analysis
    when I implemented the formula to the full sheet, it chewed up my resources and made my PC unusable

    so I used 'choosecols' to replicate the columns from main dataset into a new sheet, and applied the formula there
    I think this is required since the dataset will be continually updated
    The formula executes in seconds this way

    so when I apply formula to those columns, it appears accurate for logged, assigned is throwing a #num error and complete looks accurate (since complete dates have not been recorded completely)
    Carry-over is giving #calc error presumably because of the #num error on assigned

    I will review my data to figure out where the #num error is arising

    Screenshot 2024-05-14 211743.png

    Thanks again
    Last edited by devaloka; 05-14-2024 at 06:11 PM.

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    I cannot diagnose what I cannot see. I need some sort of sample showing the error... not a picture.

  17. #17
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    Quote Originally Posted by Glenn Kennedy View Post
    I cannot diagnose what I cannot see. I need some sort of sample showing the error... not a picture.
    I appreciate that. Here is a book with the data. Again, thank you for the help!

    Dataset.xlsx

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Well... that was a two-pipe problem... mostly caused by the way you selected the data for sheet 2. It took me well more than an hour to solve the issue!!

    It's not the way that I'd have done it, but there we are. I can't refine it becase your original data were not included in the file and the "data" were all linked to an external file to which I do not have access.


    Try it now.
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    I can't thank you enough for spending your time on this.

    Obviously there are no errors now, but unfortunately, the numbers are not correct.
    For example, your formula calculates 287 logged in Jan-24 but the actual number was 365 (confirmed by filter and count on the data). Feb-24 actual logged was 320 compared to formula calc 268.
    The assigned counts are also off, with calc for Jan and Feb-24 being 318 & 274 vs actual 302 & 262

    Can I make this easier ? What would be a better way to select the data ? I literally replicated the columns I have in the original data, and I know that dataset is not very 'clean' where sometimes data was entered in the correct format and sometimes not.
    If I drew a line in the sand, say from the start of this calendar year, ignored anything prior, and cleaned up the data for last 5 months, would that make things work better?

    By the way, this is my first exposure to LET and LAMBDA functions, I can see they are very powerful and I am trying to follow along with how you are developing this formula. As you are developing this, do you have to just visualize the data manipulation / virtual table you are creating, or do you output it somewhere temporarily ?

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Repost the file with the data, as presented to me, actually IN the file... not here:

    'https://medtronicemea-my.sharepoint.com/personal/donovd3_medtronic_com/Documents/

    WITH a header row... in case I'm losing the plot
    Last edited by Glenn Kennedy; 05-16-2024 at 05:50 AM.

  21. #21
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    Hope you are not losing the plot .... guess it depends what was in those 2 pipes :D

    Book3 Data.xlsx

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Actually, can I be a pain and change what I asked for... Please supply the RAW data. Delete the CONTENT of all un-necessary columns, but LEAVE the columns themselves in place

  23. #23
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    This should be it

    Book4 Data.xlsx

  24. #24
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    OK. I am starting over again. Please explain WHY there should be 365 logged in Jan 2024.

  25. #25
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    It is the number of requests times the number of functions required in each request.
    For example, some requests require R&D only, others require are other combinations of functions. Separated by ;
    Last edited by devaloka; 05-16-2024 at 12:30 PM.

  26. #26
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    OK. I had misinterpreted that. To avoid further confusion, please define EACH of the 4 parameters again, with special regard to which column(s) the date(s) are to be found in.

  27. #27
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    • incoming each month - defined as ((count unique col A) X (count ; col N))
    • assigned each month - defined as count of dates from AA + AF + AK which fall into each month
    • complete each month - defined as count of dates from AC + AH + AM which fall into each month
    • assigned but not complete each month (carryover) - calculated by ((new requests each month + requests assigned previous month but not complete previous month) - (complete each month))

  28. #28
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    OK. Penultimate step. Please check a few rows for accuracy. If OK, I'll set up the Named Ranges to do the chart and (with a bit of luck) we'll be finished.

    If I'm miles out, I going to set out to become an alcoholic!!

    It's a bit of a beast... but pretty quick.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  29. #29
    Registered User
    Join Date
    07-24-2012
    Location
    ireland
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20140) 64-bit
    Posts
    16

    Re: Unpivot and analyse data

    this looks awesome and exactly what I needed!

    I have successfully applied to the real dataset.

    Logged, Complete and Carry-Over counts/calcs are accurate.

    Assigned counts are off versus the way I had been calculating, but that is my fault (or the fault of the raw data at least) ... An 'assign date' has been entered for some requests which were never actually assigned. In these cases, the assign date had been entered to signify the date the decision to not assign was made! So the formula is working correctly to count the assign dates, but I plan to go back and clean up the raw data to prevent this inaccuracy.


    you mentioned penultimate step, if the ultimate step is charting, I think I am ok since the data is now in this simple table format. If the ultimate step is several pints of Guinness, then that has been hard-earned and well deserved !

  30. #30
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,434

    Re: Unpivot and analyse data

    Actually, if you wan the data to be dynamic... there's a bit more to it than it seems. You need to use Named Ranges to make it properly dynamic, as I did in Post 14. Take a look at what I set up there (CTRL-F3 to view/edit the named ranges in that post). If you need any more help, shout.

    For now, though...

    You're welcome. Thanks for letting us know that you got an answer.




    Please take a moment and consider clicking the "Add Reputation" button at the foot of any of the posts of anyone who helped you reach a solution here today.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and 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] Help in Unpivot the data
    By naveeddil in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-11-2023, 04:35 AM
  2. How to clean up data to unpivot it
    By ammartino44 in forum Excel General
    Replies: 1
    Last Post: 10-03-2018, 06:01 PM
  3. Unpivot data with VBA
    By Anton2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2017, 05:30 AM
  4. [SOLVED] Unpivot data macro
    By logisticsexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2017, 01:17 AM
  5. Reshape data and unpivot
    By hpatel517 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2016, 12:22 PM
  6. Unpivot Data
    By naveeddil in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-07-2015, 08:04 AM
  7. Unpivot Data
    By Olly in forum Tips and Tutorials
    Replies: 0
    Last Post: 04-02-2014, 05:33 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