We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!Submit Feedback
The solution to last week's challenge can be found HERE.
If you have even been shy about getting to know the crosstab/pivot tools, this challenge will serve as an excellent guide to becoming better acquainted with the tools.
An organization receives an input file like this every month or so. Additional columns are added to the file each time, representing data for more weeks. They need a workflow that will pivot the data so that each week end date is included on a row for each DMA number in column 1. The workflow needs to allow for the fact that additional columns will be included in later months.
@JoeM I look forward to someone else providing a much slicker solution. My methods are not fancy, but they do work. I made use of a generic macro I use, so I've included it in my yxzp file.
Slick? I think not. I did take a different tact than you did. I don't use the select records tool often (and I still didn't), so thanks for the reminder. I ran into several bumps in the road:
My approach was more lengthy than yours was. I didn't run yours, but I did test my output against @JoeM's output where I got identical results.
When working with clients and prospects I often get Excel "Reports" that need to be converted to DATA before real analytics can be executed. This often is time consuming. This challenge was work for me. I beat it into submission.
I didn't provide much documentation on this one, but it should be fairly easy to follow if you download the workflow. I tested it by adding a new column and amounts to make sure it would handle new columns. Worked as expected. @patrick_digan - I'll have to check out your macro when I have time.
For extra credit I'll post my first attempt at this solution with no documentation. In this version I kept the input file that I added an additional column to. Still works and slightly faster than my previous posted solution. Why does cross tab tool add underscores to column headings? Thanks for the challenging exercise @JoeM.
Solution attached. Most similar to one of Alex's solutions, I believe.
However, I think I also uncovered an issue with the output results as posted in the original workflow - in the case where there was not both an Inside & Outside sales column, therefore no Total Sales column for that week (in this example, week 2016-04-24), then the Total amount for that week was showing as zero in the posted output results, despite there being an amount for Inside sales. So I added a formula at the end to check to see if Inside POS + Outside POS = Total POS... if it didn't, then I replaced the Total POS value with Inside POS + Outside POS. Which is also a good check in case someone posted the wrong value in Total POS to begin with.
Hope this helps! :)