Elisha

Members
  • Content

    3,164
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Elisha

  1. Ok, it looks like I got it with the Pivot function. I had to use it 7 times though. Anyway, I'm having some div 0 errors that I can't seem to figure out. For the purpose of this query: TY - "This Year", LY - "Last Year", Diff - (TY-LY), and Diff pct - (TY-LY)/LY. So for example: IsNull(Sum(Vol_TY)/NullIf(Sum(NumUnits_TY),0),0) AS AvgUnitPrice_TY, (works fine) IsNull(Sum(Vol_LY)/NullIf(Sum(NumUnits_LY),0),0) AS AvgUnitPrice_LY, (works fine) (IsNull(Sum(Vol_TY)/NullIf(Sum(NumUnits_TY),0),0) - IsNull(Sum(Vol_LY)/NullIf(Sum(NumUnits_LY),0),0)) AS AvgUnitPrice_Diff, (works fine) --IsNull((IsNull(Sum(Vol_TY)/NullIf(Sum(NumUnits_TY),0),0) - IsNull(Sum(Vol_LY)/NullIf(Sum(NumUnits_LY),0),0))/NullIf(Sum(Vol_LY)/Sum(NumUnits_LY),0),0) AS AvgUnitPrice_Diff_Pct, (DIV 0 error AARRRRGGGHHH!!!) (Yes, I obviously commented it out because of the error.) The fields are dollar sales volume and number of units (to get the average price per unit). As an aside, I asked those who were involved in creating the tool I'm dumping the data into why they want fields created for the Diff and percent and not just have the tool calculate them (like any BI tool would) and they didn't have a good answer. That as they say is another discussion...
  2. Elisha

    Computer

    In case you prefer, a friend of mine refers to himself as a Recalcitrant Medievalist.
  3. Update: I was able to successfully create (or should I say 'Pivot') one of the three queries (actually, really only two - one is a slight variant of the other with just a different time period). The one I successfully did involved one quantitative field, pivoting months from vertical to horizontal. I used this basic syntax: Sample data: USE AdventureWorks2008R2 ; GO SELECT DaysToManufacture, AVG(StandardCost) AS AverageCost FROM Production.Product GROUP BY DaysToManufacture; Here is the result set. DaysToManufacture AverageCost 0 5.0885 1 223.88 2 359.1082 4 949.4105 Example: -- Pivot table with one row and five columns SELECT 'AverageCost' AS Cost_Sorted_By_Production_Days, [0], [1], [2], [3], [4] FROM (SELECT DaysToManufacture, StandardCost FROM Production.Product) AS SourceTable PIVOT ( AVG(StandardCost) FOR DaysToManufacture IN ([0], [1], [2], [3], [4]) ) AS PivotTable; which produces: Cost_Sorted_By_Production_Days 0 1 2 3 4 AverageCost 5.0885 223.88 359.1082 NULL 949.4105 By the way, I have 17 qualitative columns preceding, but basically the Customer/product combo is the basic concept (data pulled by date though). Now, I need to pivot multiple quantitative fields as previously mentioned , but group to two time periods (This year and Last year or whatever) and then of course have units_TY, units_LY, $_TY, $_LY, etc....(about 10 quantitative fields total). I'm not sure if the above will work for several. I think I'll try a CASE statement in the select in the meantime. Help?
  4. SQL Server...working on 2014 to be precise.
  5. I keep getting errrors around the outer ')' ...doesn't seem to make sense, as I have other CASE statements with the same syntax working fine.
  6. Serious question. I'm a part timer at this and rather intermediate-ish (if that) and need to create a file to dump into some 3rd party reporting system. The file needs to be in this form: Customer Product #_of_cases_TY #_of_cases_LY ABC Liquor Coors 12pks 103 105 ABC Liquor Pabst 6pks 89 73 Where cases TY = "this year" rolling 12 months (i.e. 9/2013 - 8/2014) and LY = "last year" rolling 12 months (i.e. 9/2012 - 8/2013). I can get the individual aggregate periods, but don't know how join or "pivot" the two periods to get them side by side. Yes, there will be Customers and products in each period that are not in the other (i.e. need to have 0 values where one time period doesn't have data in the other). Can our awesome dz.com crowd help?
  7. Elisha

    Bill Dause

    I retired three weeks ago, but plan to unretire on Saturday.
  8. I guess I'll spare exposing the gym today.
  9. What is your temperature NOW. Further, there are TWO things to consider here; Would you be a threat to yourself? Would you be a threat to others? If your temperature is above normal consider the fact you might be fucking up other people's lives. It's definitely lower - I don't have access to a thermometer. And even lower yet since I took some ibuprofen. Good points above.
  10. So...looks like I had a 103 temp last night. Feeling better, but still feverish. I want go to my usual cardio-kickboxing class later today ("BODY COMBAT" for those 24HR gym people). Benefits/drawbacks about doing this later? I think the worst is behind me.
  11. Well, that's the thing about languages though, it doesn't matter a damn bit what any individual likes or dislikes. Common usage really does rule and especially over time. But the biggest problem with just "accepting" this is the misconception behind what the words mean. 5 years ago, if someone had a quadcopter, everyone would just think it was a really cool remote control helicopter toy that had a much bigger range than old rc helicopters/planes. Now, since the media is calling everything a "drone", it is some scary spying (or even weapon thingy) that we all need to be scared of. By mainstream media essentially changing terms on us (the public at large), they are inadvertently (or maybe deliberately) fear mongering, creating paranoia where it shouldn't exist. In a much more mild way, it is a similar case with stupid business buzzwords.
  12. Well, yes but... I believe someone here may have posted a military definition recently that was fairly specific and not what the media has adopted. Anyone know that again?
  13. I think you air/military industry (pilots and (ex-)military) can help me out with this and someone may have posted before. It seems the media has redefined any flying remote control object a drone, which just bugs the crap out of me. Since when is a toy helicopter (yes, quadcopters too) a drone? I'm hoping this doesn't get political, but I know that is an easy possibility with this crwod.
  14. Maybe Putin will do the dirty work for us? Doesn't seem smart of ISIS/ISIL to provoke Putin. http://news.yahoo.com/militants-vow-throne-putin-over-syria-support-225140129.html
  15. I saw the meme with Ann Coulter two days ago.
  16. ***FAA jurisdiction over even a paper plane flown outdoors by a child I've been dealing with the FAA for over 49 yrs now. There is little intelligence within that agency. So far they do not even know where to begin to develop regulations for drones. I hope no one is holding their breath while the FAA completes the regs. JerryBaumchen At the risk of hijacking the thread, since when was any remote controlled plane/copter/flying insect re-defined as a "drone"? The media seems to have lost any common sense with this.
  17. Arriving Friday 8/8 at 8pm in Kalispell and need a ride. Will get a rental car if I have to. Anyone?
  18. Have 950+ and still not a real chop. (I don't count the skyhook demo, with tertiary bellymount.)
  19. Forget FGM (while awful) - that's a sub issue. The real is the wholesale slaughter of all non-Muslims in their new "caliphate". While the below from CNN says "Christians", their actual statements was for all non-Muslims (and I think Shiite's too). http://www.cnn.com/2014/07/24/world/iraq-violence/index.html?hpt=hp_c2 "ISIS is waging war against the Iraqi government and has taken over several cities. It is seeking to create an Islamic caliphate that encompasses parts of Iraq and Syria and has begun imposing Sharia law in the towns it controls. The group has threatened to destroy any shrine it deems un-Islamic. Christian families fled Mosul this month after the al Qaeda splinter group issued an ultimatum to Iraqi Christians living there: either convert to Islam, pay a fine or face "death by the sword.""
  20. Skydive Santa Rosa WAS a towered DZ. It was a tandem mill (Cessna 182) at Sonoma County (Charles Schulz) Airport up until it closed in 2005. They marketed the dz as the only tower controlled airport in the state/country...but when you think about it, its a mixed blessing for the business. Probably no chance in hell to re-open a dz there now with all of the commercial traffic since then.
  21. Arriving: Friday evening 8/8. Departing: Monday evening 8/11. A pickup Friday night from the Kalispell airport would be helpful. Also, a dropoff Monday late morning to the same place as well. Will then rent a car for the rest of the day Monday to explore Glacier National Park.
  22. dbcooper and Deb drdive Ladydiver madjohn monkycndo NWFlyer Pattersd rafael wmw999 Szky and Jeanne AnalMike Elisha