|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 8:15 PM
Points: 1,409,
Visits: 4,509
|
|
thx
i've read tally table articles here for the last few years and never thought i had a use for them. last 6 months i've been building a performance data warehouse but haven't done too much in getting use out of the data. going to build a tally table into it just to divide the data into weeks, months, etc to see if we can find trends later on
https://plus.google.com/100125998302068852885/posts?hl=en http://twitter.com/alent1234 x-box live gamertag: i am null [url=http://live.xbox.com/en-US/MyXbox/Profile[/url]
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Yesterday @ 3:26 PM
Points: 31,425,
Visits: 13,738
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Saturday, October 16, 2010 2:37 PM
Points: 19,
Visits: 69
|
|
Hi - Actually this isn't a very specific use of a tally table for one customer.
This is called the "Retail Calendar" and is used by pretty much every retail business including the one I work for. We have retail stores and we have a large factory.
You can google it and look it up.
I don't know if this person is on the retail calendar or if he just has a weird fiscal set up.
I have been using a similar tally table for several years. One of the things I include is whether that particular date is a "working factory day". That doesn't mean to exclude sat/sun/holiday. As we approach the holidays we often have sat/sun where the factory works and ships product. So after the fact we add a Y if the factory worked that day.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 6:57 PM
Points: 2,427,
Visits: 6,029
|
|
Carolyn Stern (8/2/2010) Hi - Actually this isn't a very specific use of a tally table for one customer.
This is called the "Retail Calendar" and is used by pretty much every retail business including the one I work for. We have retail stores and we have a large factory.
You can google it and look it up.
I don't know if this person is on the retail calendar or if he just has a weird fiscal set up.
I have been using a similar tally table for several years. One of the things I include is whether that particular date is a "working factory day". That doesn't mean to exclude sat/sun/holiday. As we approach the holidays we often have sat/sun where the factory works and ships product. So after the fact we add a Y if the factory worked that day.
Interesting, this is for a retail company, but I don't know if they are on a standard "retail calendar" or if they've made up their own that is just very similar. Does the standard one have the "correction" of an additional week that I entered?
Thanks for the information!
-------------------------------------- When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions. -------------------------------------- It’s unpleasantly like being drunk. What’s so unpleasant about being drunk? You ask a glass of water. -- Douglas Adams
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 8:15 PM
Points: 1,409,
Visits: 4,509
|
|
wish i just had a tally table
bought my wife an iPhone 4 just now and needed to know which days were week 30 of 2010 since that when her phone was manufactured. rumor is that the latest iphones have a matte coating on the antennal to avoid the death grip issue
Apple uses the week of manufacture as part of the serial number in all of their products
https://plus.google.com/100125998302068852885/posts?hl=en http://twitter.com/alent1234 x-box live gamertag: i am null [url=http://live.xbox.com/en-US/MyXbox/Profile[/url]
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 6:57 PM
Points: 2,427,
Visits: 6,029
|
|
alen teplitsky (8/2/2010) wish i just had a tally table
bought my wife an iPhone 4 just now and needed to know which days were week 30 of 2010 since that when her phone was manufactured. rumor is that the latest iphones have a matte coating on the antennal to avoid the death grip issue
Apple uses the week of manufacture as part of the serial number in all of their products
I didn't know that about Apple. Has she been having a problem with the phone? My fiance and I have iPhone 4s and we haven't had the problem. Plus, they are giving out free cases through an app for the phone.
-------------------------------------- When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions. -------------------------------------- It’s unpleasantly like being drunk. What’s so unpleasant about being drunk? You ask a glass of water. -- Douglas Adams
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, March 22, 2013 8:03 AM
Points: 56,
Visits: 317
|
|
I have also used Jeff's code as a jumping off point to do date tally tables. Julian date conversions were what started me down this road. I usually use the days int value as the pk_for the table with select cast(getdate() as int) Language conversions and other wierd stuff can then be stored in the date table that I usually put in master. John.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 8:15 PM
Points: 1,409,
Visits: 4,509
|
|
Stefan Krzywicki (8/2/2010)
alen teplitsky (8/2/2010) wish i just had a tally table
bought my wife an iPhone 4 just now and needed to know which days were week 30 of 2010 since that when her phone was manufactured. rumor is that the latest iphones have a matte coating on the antennal to avoid the death grip issue
Apple uses the week of manufacture as part of the serial number in all of their productsI didn't know that about Apple. Has she been having a problem with the phone? My fiance and I have iPhone 4s and we haven't had the problem. Plus, they are giving out free cases through an app for the phone.
new iphone 4 is still in the box. just bought it from the NYC Upper West Side store 90 minutes ago. called and they had a lot of stock.
the death grip issue is only if you're in a low signal level zone. wife has had a 3G since 2/2009 and i had a 3GS since June of 2009. i knew the 5 bars most of the time was a bunch of BS and something apple put in the software. i also had something similar to the death grip with my 3GS a few times when using it on wifi. while SJ was giving his we're as bad as everyone else speech i replicated the issue on my Blackberry Curve on one half of the room i was in. the other half the room has a better signal
and in my opinion apple knew about it before the release. i though it was strange that they were hyping the bumpers as well and i thought that touching the antenna may cause issues. or maybe it would increase the signal since it would allow the user to be the antenna as well.
a lot of the hysteria is just internet hype. there are PR/marketing firms who hire people to do nothing but post on forums and youtube and whatever. apple is not perfect but i'm 99% sure one of their competitors created the hysteria via one of these new advertising firms
for the serial number i've known about it for a while. when the 27" iMac's came out last year with the yellow screens everyone on MacRumors was tracking the week of manufacture to see if the issue was fixed. few weeks ago Gizmodo ran an article that Genius Bar iPhone 4 replacements were different than launch ones. which is why i wish i had a tally table and instead had to google "week 30 2010" to check the dates
https://plus.google.com/100125998302068852885/posts?hl=en http://twitter.com/alent1234 x-box live gamertag: i am null [url=http://live.xbox.com/en-US/MyXbox/Profile[/url]
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, October 08, 2011 11:18 PM
Points: 1,
Visits: 22
|
|
A CTE could also be used to generate a tally table in memory. This can come in handy if you don't have access to create a table or wish to create a table for short-term use.
WITH Tally AS ( SELECT TOP 20000 ROW_NUMBER() OVER (ORDER BY SC1.name) AS N FROM master.dbo.syscolumns AS SC1 CROSS JOIN master.dbo.syscolumns AS SC2 )
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 6:57 PM
Points: 2,427,
Visits: 6,029
|
|
Everett T (8/2/2010)
A CTE could also be used to generate a tally table in memory. This can come in handy if you don't have access to create a table or don't wish to create a table for short-term use. WITH Tally AS ( SELECT TOP 20000 ROW_NUMBER() OVER (ORDER BY SC1.name) AS N FROM master.dbo.syscolumns AS SC1 CROSS JOIN master.dbo.syscolumns AS SC2 )
Sure, or you could just use a temp table or table variable. Still no need to use a CTE to do it either. Heck, if you really wanted to leave no long-term footprint, just make both your tally table and your date table temp tables and drop them when you're done. Or make them both table variables, which is harder to use if you want to keep adding bits and testing them as you add them, but still works.
-------------------------------------- When you encounter a problem, if the solution isn't readily evident go back to the start and check your assumptions. -------------------------------------- It’s unpleasantly like being drunk. What’s so unpleasant about being drunk? You ask a glass of water. -- Douglas Adams
|
|
|
|