Getting Same Store functionality to work across prior periods, not just current

I have a basic Sales table, with a Store Key, Date Key, and dollar amount.  I also have a SameStore table, which for every combination of StoreKey and DateKey, says whether or not that store should be considered "Same Store" (was operational
last year for the same time period) on a month to date, qtr to date, and YTD basis.  The MTD Y/N, QTD Y/N and YTD Y/N are available via the same store dimension.  Via my date dimension, I have all the usual date calcs, such as prior month, prior
year, QTD, etc...
It is very easy to query the totals for all of my stores as of Sept 2014 and get the current sales amout, as well as get the prior month, prior year, and so on.  Now, if I only want to see the totals for stores that should be considered "same store"
as of Sept 2014, I can throw the MTD=Y up into my filter and then the current month's total will adjust to only show stores where their same store flag for Sept 2014 is set to a YES.  All of the NO's for Sept 2014 get removed... however, if one of those
NO's was considered Same Store in August, their $$$ number is still being incldued in the Prior Month date calc.  I don't want it there, becuase as of September (the focus of my report) they are not considered same store anymore.  
I am getting this:
As of September 2014, Same Store=Yes
Store Current$
Last Month$ Last QTR$
1 (closed 8/15) $0.00
$100.00 $125.00
2 $50.00
$75.00 $60.00
3 $60.00
$65.00 $85.00
But I really want this:
As of September 2014, Same Store=Yes
Store Current$
Last Month$ Last QTR$
1 (closed 8/15) $0.00
$0.00 $0.00
(or this whole row can just be gone completely)
2 $50.00
$75.00 $60.00
3 $60.00
$65.00 $85.00
Just because Store 1 was considered to be a "Same Store" in August doesn't matter since I am running my report as of September.  It is not "Same Store" as of September, so it should vanish from all my calculations.
Currently, dimStore, dimDates, and dimSameStoreStatus all hang off of the main Sales fact table.  I know this is part of the problem.  We are going to try and connect the dimSameStore to the dimStore and dimDates tables rather than the fact table,
but I not sure if my overall design is right for this or not in general.
Has anybody had to do something similar?  If I get a solution from somebody (or a great hint that helps me solve it), I'll send you a Starbucks gift card. 
Thanks in advance!
Mgr, Data Warehouse Svcs

Hi D,
The way I typically deal with this is to use a table, like you have, to mark whether the store was comparable for that Period.  Then, when you run a query, you are comparing two or more periods.  So, your query should restrict the scope to only
include stores that were marked as comparable in all periods.  
For example, if you are comparing this month with same month last year, you should only include stores that were comparable this month and same month last year.  If you have a query that is showing month on month growth for all the months this FY, you
should only include stores that were comparable for all months so far this year.  This is more common for a rolling n period report.
I find it quite interesting that most retailers use some variant of "Same Store Sales" with the express purpose of being able to compare performance with other retailers.  However every retailer has their own definition of what a comparable
store is.
Hope that helps,
Richard

Similar Messages

  • Hi, I have a late 2011 MacBook Pro but cant get the mirroring function to work with Apple TV.  I've got the most recent Software 10.7.5 but cant see the mirroring icon or turn this on.  I'm able to mirror from my Ipad but not my Mac, any thoughts?

    Hi, I have a late 2011 MacBook Pro but cant get the mirroring function to work with Apple TV.  I've got the most recent Software 10.7.5 but cant see the mirroring icon or turn this on.  I'm able to mirror from my Ipad but not my Mac, any thoughts?

    Welcome to the Apple Support Communities
    AirPlay Mirroring is supported on your Mac, but it needs OS X Mountain Lion (10.8). See > http://support.apple.com/kb/HT5404
    You have two possibilities:
    1. Make a backup, open App Store and purchase Mountain Lion to upgrade to this OS X. Then, you will find the AirPlay Mirroring icon at the top right of the display, on the menu bar, or on System Preferences > Displays.
    2. Keep OS X Lion and use AirParrot > http://www.airparrot.com
    Both options work properly, but I recommend AirPlay Mirroring as it doesn't need a third-party program

  • I have tried to reindex my messages but I still can not get the search function to work in email

    I have tried reindecing my messages by rebuilding the library but I still can't get my message function to work in mail.  Any proposed solutions much appreciated.

    Some of your user files (not system files) have incorrect permissions or are locked. This procedure will unlock all your user files, reset their ownership, and remove their access-control lists. If you've set special values for those attributes, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Back up all data.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR..; sudo chown -R $UID:staff ~ $_; sudo chmod -R u+rwX ~ $_; chmod -R -N ~ $_; } 2>&-
    This time you'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • I have a MacBook, made in 2010. I can't get the eject function to work. I have a DVD in now and want to eject it and put another one in. Command-E, dragging it to the trash or Find-Eject does not work. Ideas?

    I have a MacBook, made in 2010. I can't get the eject function to work. I have a DVD in now and want to eject it and put another one in. Command-E, dragging it to the trash or Find-Eject does not work. Ideas?

    Hi there. Hear are some other options . Hold down for click on the track pad while restarting and keep it down all the way thru boot. Or use right click on a mouse. If it's stuck, sometimes sticking a business card in top edge of slot while trying the eject option can work.

  • How do I get the tint function to work in CS5?

    I rrecently installed CS5 In Design in Windows 7.  How do I get the tint function to work?

    This is how you create a tint:
    If it's not working, you might try restoring your InDesign preferences:
    Trash, Replace, Reset, or Restore the application Preferences

  • On Apple TV, my pictures have loaded, but I cannot get the slideshow function to work.  It has been "loading" 28 pictures for over 5 minutes.  What is wrong?

    On Apple TV, my pictures have loaded, but I cannot get the slideshow function to work.  It has been "loading" 28 pictures for five minutes.  What am I doing wrong?  I have Windows 7 on my PC.

    I don't have any direct experience with D-Link equipment, but I may be able to provide some general advice. See if you can use a Web browser to connect to the D-Link's configuration screen. This probably involves visiting a URL such as http://www.192.168.0.1 . If you haven't changed the sign-on parameters, a quick Google search should find them for you.
    Once there, note as many configuration details as you can find. You'll need those to configure your Time Capsule.
    Use the AirPort Utility to configure the Time Capsule.
    One last thing: It's quite possible that the Verizon network will have locked onto the "MAC" address of your D-Link router. Something needs to be done to reset this. If there's a separate box at your house that came with the FIOS equipment that's "upstream" from the D-Link router, I'd cycle power on it to see if that does the job. Otherwise you'll probably need to call Verizon to ask them to reset things once your Time Capsule is installed in place of the D-Link router.

  • How do i get my ipod touch to work if i have not used it in a while

    how do i get my ipod touch to work if i have not used it in a while. we have not used it in about 4 months and it does not charge or turn on

    If you can connect the iPod to a computer you can restore using iTunes >  Apple - Support - iPod touch - Restore Troubleshooting Assistant

  • Can't get the view function to work properly...

    For some reason, I no longer can get the VIEW function to do what I want. Specifically, everytime I try to get ARTIST to show, it shows ALBUM BY ARTIST instead. This does NOT happen in my downloaded file, only in the entire library. Anyone else have this happen to them? Please advise.

    In the Masked Artwork folder go to a photo with the keyword "food".   Does it have a check mark at food?
    I have had situations where the photo had the keyword printed under the title, but the check mark is not present.  A search with that combination for the keyword yields "no image found".
    Go to bottom of your keywords panel and look under Other Keywords.  Is Food there and checked?  If so you can right click on this keyword and Find will work.  If you have the type of situration where keyword has no check mark in your tree, except for at Other, I found you have to delete them and then re-enter them.  It will then work.
    Let me know what you find discover.

  • Can't get my first Function to work!

    Hi everyone,
    I have been trying to make a function, but it won't compile without errors. I already checked the forum and other sites for an answer, but I can't seem to find one. So here's my function (I'm taking an integer value as an input and returning a char):
    CREATE OR REPLACE FUNCTION fCotePourNote (laNote IN Inscription.note%TYPE)
    RETURN Inscription.cote%TYPE IS
         laCote CHAR(1);
    BEGIN
              IF laNote >=90 THEN
                   laCote := 'A';
              ELSE IF laNote >=80 THEN
                   laCote := 'B';
         ELSE IF laNote >=70 THEN
                   laCote := 'C';
              ELSE IF laNote >=60 THEN
                   laCote := 'D';
              ELSE
                   laCote := 'E';     
              END IF;
    RETURN laCote;
    END fCotePourNote;
    When I try to run my script, I get tihis error :
    22/5 PLS-00103: Encountered the symbo "FCOTEPOURNOTE" when expecting one
    of the following:
    if
    I really don't get why since I correctly ended my if.
    Any help would be greatly appreciated :-)

    /* Formatted on 12/6/2012 8:17:23 AM (QP5 v5.215.12089.38647) */
    CREATE OR REPLACE FUNCTION fCotePourNote (laNote laNote IN Inscription.note%TYPE)
       RETURN  Inscription.cote%TYPE
    IS
       laCote   CHAR (1);
    BEGIN
       IF laNote >= 90
       THEN
          laCote := 'A';
       ELSIF laNote >= 80
       THEN
          laCote := 'B';
       ELSIF laNote >= 70
       THEN
          laCote := 'C';
       ELSIF laNote >= 60
       THEN
          laCote := 'D';
       ELSE
          laCote := 'E';
       END IF;
       RETURN laCote;
    END fCotePourNote;In if statement you have used
    if
    else if -> Separetely,
    else if
    end if
    end if
    end if
    if you want to use only one end if
    if
    elsif
    elsif
    end if
    check the if syntax, your issue will be solved.
    in your case these many end if's should be there
    /* Formatted on 12/6/2012 8:20:08 AM (QP5 v5.215.12089.38647) */
    CREATE OR REPLACE FUNCTION fCotePourNote (laNote laNote IN Inscription.note%TYPE)
       RETURN  Inscription.cote%TYPE
    IS
       laCote   CHAR (1);
    BEGIN
       IF laNote >= 90
       THEN
          laCote := 'A';
       ELSE
          IF laNote >= 80
          THEN
             laCote := 'B';
          ELSE
             IF laNote >= 70
             THEN
                laCote := 'C';
             ELSE
                IF laNote >= 60
                THEN
                   laCote := 'D';
                ELSE
                   laCote := 'E';
                END IF;
             END IF;
          END IF;
       END IF;
       RETURN laCote;
    END fCotePourNote;

  • How to get PHP mail() function to WORK?

    The topic title speaks for itself. I only want the exact following code to actually send an e-mail, just as it does on any external server:
    <?php
    mail(<i>an e-mail address</i>, <i>a subject</i>, <i>some text</i>);
    ?>
    Is it possible?
    I have the sendmail_path set to /usr/sbin/sendmail -t -i in php.ini, and MAILSERVER=-YES- in hostconfig.
    I would like to avoid using sendmail's -f option if possible (this does not work for all e-mail addresses anyway).
    Mac mini Core Duo   Mac OS X (10.4.7)  

    Hi Neithan,
       If, as your profile indicates, you are using Tiger, you are using postfix when you use the "sendmail" command. Sendmail is no longer installed but postfix comes with an "emulator" to keep legacy stuff from breaking. It's still a good command line method for sending mail.
       I'm not sure if setting MAILSERVER=-YES- causes postfix to listen on the smtp port or just for local connections. However, I thought that local connections were sufficient to send mail. Try it and if it doesn't work use Postfix Enabler. Just remember that changing the hostconfig file doesn't take effect until the next reboot. (or run of SystemStarter)
       Also remember that most ISPs don't accept mail from unrecognized machines anymore.
    Gary
    ~~~~
       Money isn't everything -- but it's a long way ahead of
       what comes next.
             -- Sir Edmond Stockdale

  • I cannot play music from my library on either my external drive or my laptop - keep getting same message "___ song (all of them) could not be used because the original file could not be found. I have tried changing the path in prefernces many times.

    I cannot play music from my libray on either my external drive or my laptop. I keep getting the same message - "___ song (all of them) could not be used because the original file could not be found. Would you like to locate it?" I have changed the path several times under preferences and it still won't recognize any songs from either my laptop hard drive or my external drive. I can't play any music at all.

    I think I've fixed this on my machine.  If you look in the ITunes folder there is a subfolder called Previous iTunes Libraries.  In my case for some reason this contained the one which had always worked and a new one was in the main  folder.  I closed iTunes, deleted the new one, and moved the old one back to the main folder, then opened iTunes.  It then rebuilt the library and it plays correctly.  Hope it works for you.

  • HT4623 How do I get the calendar to show the whole month and not just the day or week.

    How do I get the calendar on my updated i phone 7 to show the whole month and not just the week or the day?

    Touch the arrow (or word) at upper left (e.g. September).

  • HT2845 how can I get the scroll function to work on my magic mouse?

    I got my magic mouse to work perfectly with my macs but I also have a work computer which is a windows vista lenovo.  All functions work with the mouse on my pc but the scroll function when I'm in excel which is a big deal for me because I am an accountant.
    tks.

    Use the Image Capture application. It is already installed on your computer.
    See:
    Mac Basics: Using a scanner
    http://support.apple.com/kb/ht4505
    I hope you get this issue sorted out.
    Austin

  • I cannot get my help function to work on any Creative Suite CS4 program

    case #181086014 I installed the suite and everything seemed ok when I installed it. When I go to use Photoshop, Ilustrator and the other programs, the help function does not work. A box appears and says: There was an error launching the Adobe Help application. You may need to re-install the application and the Help component. I tried uninstalling and re-installing. Then I just re-installed it over after it was installed. I don't know what to do to get it to work. Please help

    Would this be helpful:
    http://kb2.adobe.com/cps/409/kb409020.html

  • Getting the Email function to work

    I have synced my IPhone to my computer and am getting an error message that it didn't complete or set up the email function. Why is that? I have also looked at the settings and made a couple of changes but it still will bring in my messages and send my outgoing messages.
    Is there a phone number to call for help in walking me through this email setup process? I am using Comcast cable and using Outlook2007 to manage my emails.
    Waldo Yeager

    Easiest thing to do is to walk into the Apple Store and goto the Genius Bar, and let then show it to you physically.
    I just had them show me how to set-up an account on it, separate from what I already had with my .Mac account.

Maybe you are looking for