Viewing 7 posts - 1 through 7 (of 7 total)
John_P (3/5/2013)
Now, this only works here because there are...
March 6, 2013 at 12:35 am
Problem solved! 🙂
Here is the sql-statement that did the trick!
SELECT *, (ISNULL(Denmark,0) + ISNULL(Finland,0) + ISNULL(Lithuania,0) + ISNULL(Norway,0) + ISNULL(Sweden,0)) /
(CASE WHEN ISNULL(Denmark,0)>0 THEN 1 ELSE 0 END +
CASE WHEN...
March 5, 2013 at 3:52 am
Okey!
I have come a bit on the way to a solution and have included a script for creating a test-table with sample dummy data in it!
The result from the sql-statement...
March 5, 2013 at 2:19 am
You need to calculate your averages using a GROUP BY and then add these back to your PIVOT.
Here's a start on your sample data: "snip"
SELECT Country, Manufacturer, MarketingName, AvgDropRate=AVG(DropRate)
FROM @Phones
GROUP...
March 5, 2013 at 12:21 am
Phil Parkin (3/4/2013)
Please follow the link in my signature to get details of how to post sample DDL, data and desired results to get the best response to your question.
I´m...
March 4, 2013 at 6:51 am
Hi Dwain!
I´m dynamicly building my statement and adding and removing countrys from the sql-question on the fly depending on what filteroptions the user has choosen.
I´m for the moment generating this...
February 1, 2013 at 9:56 am
Solved!
I got help from another forum and here is the answer that worked like a charm!
You can use the PIVOT operator like shown below. If you have an unknown number...
January 31, 2013 at 6:41 am
Viewing 7 posts - 1 through 7 (of 7 total)