My data in Database Table …
SELECT [Quote Reference Number]
,[Value]
,[Method]
,[Country]
,[SubRegion]
,[Route 1 or Route2]
,[TYPE A or B ]
FROM Table 1
My Desired Summary view
WORLD VIEW
Subregion | Country | Count of Route1 + Type A quotes | Count of Route1 + Type B quotes| Count of Route2 + Type A quotes | Count of Route2 + Type B quotes| All Routes & Types |
EMEA VIEW
Subregion | Country | Count of Route1 + Type A quotes | Count of Route1 + Type B quotes| Count of Route2 + Type A quotes | Count of Route2 + Type B quotes| All Routes & Types |
I could do this by creating a table with 2 rows and just doing lots of sql queries to populate all the fields but was told it could be done by Pivoting in the database but dont know how exactly ?
Can anyone offer some assistance ?
Pivot in the case would be difficult (but not impossible) because the
FOR... INclauses contains a field and a set of values respectively, not Conditional statements. You’re better of with asum/casee.g.