query: #defaultView:Map{"hide":["?geoshape","?rgb","?WelshSpeakerPercentage"],"layer":"?WelshSpeakerPercentage"}
  SELECT DISTINCT 
  ?area ?areaLabel
  ?data
  #?Change ?2011 ?2001 
  #?2001_Population ?2001_Speakers ?2001_Percent
  #?2011_Population ?2011_Speakers ?2011_Percent
  #?Population_Change ?Speakers_Change ?Percentage_Change
  ?WelshSpeakerPercentage
  ?geoshape 
  ?rgb 
  WHERE {
     
    ?area wdt:P3896 ?geoshape .
    
    BIND(CONCAT(?2001, " ----- ", ?2011, " ----- ", ?Change) as ?data) 
    
    { SELECT ?area ?Change ?2011 ?2001 ?2011_percent WHERE {
      
    BIND(CONCAT("2001: ", ?2001_Population, " ; ", ?2001_Speakers, " ", ?2001_Percent) as ?2001)
    BIND(CONCAT("2011: ", ?2011_Population, " ; ", ?2011_Speakers, " ", ?2011_Percent) as ?2011)
    BIND(CONCAT("Change 2001-2011: ", ?Population_Change, " ; ", ?Speakers_Change, " ", ?Percentage_Change) as ?Change)
  
    { SELECT ?area ?2001_Population ?2001_Speakers ?2001_Percent ?2011_Population ?2011_Speakers ?2011_Percent ?Population_Change ?Speakers_Change ?Percentage_Change ?2011_percent WHERE {
    
    BIND(CONCAT("Population: ", STR(?2001_population)) as ?2001_Population)
    BIND(CONCAT("Welsh speakers: ", STR(?2001_speakers)) as ?2001_Speakers)
    BIND(CONCAT("(", SUBSTR(STR(?2001_percent),0,5), "%).") as ?2001_Percent)
    
    BIND(CONCAT("Population: ", STR(?2011_population)) as ?2011_Population)
    BIND(CONCAT("Welsh speakers: ", STR(?2011_speakers)) as ?2011_Speakers)
    BIND(CONCAT("(", SUBSTR(STR(?2011_percent),0,5), "%).") as ?2011_Percent)
    
    BIND(CONCAT("Population change: ", STR(?change_population)) as ?Population_Change)
    BIND(CONCAT("Welsh speakers change: ", STR(?change_speakers)) as ?Speakers_Change)
    BIND(CONCAT("(", SUBSTR(STR(?change_percent),0,5), "%).") as ?Percentage_Change)
      
    { SELECT ?area ?2001_speakers ?2001_population ?2001_percent ?2011_population ?2011_speakers ?2011_percent ?change_speakers ?change_population ?change_percent WHERE {
    
    BIND(?2011_percent - ?2001_percent AS ?change_percent)
    BIND(?2011_population - ?2001_population AS ?change_population)
    BIND(?2011_speakers - ?2001_speakers AS ?change_speakers)
    
    { SELECT ?area ?2001_speakers ?2001_population ?2001_percent ?2011_population ?2011_speakers ?2011_percent WHERE {
    
    BIND(100 * ?2001_speakers / ?2001_population AS ?2001_percent)
    BIND(100 * ?2011_speakers / ?2011_population AS ?2011_percent)
  
    { SELECT ?area ?2001_speakers ?2001_population ?2011_population ?2011_speakers WHERE {
    ?area p:P2936 ?2011_SpeakersStatement ;
          p:P1082 ?2011_PopulationStatement .
    
    ?2011_SpeakersStatement ?pq_qual ?pq_obj .
    ?qual wikibase:qualifier ?pq_qual .
    ?2011_SpeakersStatement pq:P585 "2011-01-01T00:00:00Z"^^xsd:dateTime ;
                   pq:P1098 ?2011_speakers .
    
    ?2011_PopulationStatement ?pq_qual ?pq_obj .    
      ?qual wikibase:qualifier ?pq_qual .
      ?2011_PopulationStatement pq:P585 "2011-01-01T00:00:00Z"^^xsd:dateTime ;
                     ps:P1082 ?2011_population .
    
    { SELECT ?area ?2001_speakers ?2001_population WHERE { 
      ?area wdt:P31 wd:Q15979307 ;
            p:P2936 ?2001_SpeakersStatement ;
            p:P1082 ?2001_PopulationStatement .
      
      ?2001_SpeakersStatement ?pq_qual ?pq_obj .    
      ?qual wikibase:qualifier ?pq_qual .
      ?2001_SpeakersStatement pq:P585 "2001-01-01T00:00:00Z"^^xsd:dateTime ;
                     pq:P1098 ?2001_speakers .
      
      ?2001_PopulationStatement ?pq_qual ?pq_obj .    
      ?qual wikibase:qualifier ?pq_qual .
      ?2001_PopulationStatement pq:P585 "2001-01-01T00:00:00Z"^^xsd:dateTime ;
                     ps:P1082 ?2001_population .
    } }
      } }
      } }
      } }
      } }
      } }
    
   BIND(
      IF(?2011_percent < 10, "0-10%",
      IF(?2011_percent < 20, "10-20%",
      IF(?2011_percent < 30, "20-30%",
      IF(?2011_percent < 40, "30-40%",
      IF(?2011_percent < 50, "40-50%",
      IF(?2011_percent < 60, "50-60%",
      IF(?2011_percent < 70, "60-70%",   
      "70%+")))))))
      AS ?WelshSpeakerPercentage). 
    
    BIND(
      IF(?2011_percent < 10, "ffe6e6",
      IF(?2011_percent < 20, "ffb3b3",
      IF(?2011_percent < 30, "ff8080",
      IF(?2011_percent < 40, "ff4d4d",
      IF(?2011_percent < 50, "ff1a1a",
      IF(?2011_percent < 60, "e60000",
      IF(?2011_percent < 70, "b30000",   
      "800000")))))))
      AS ?rgb).
   
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    }
  ORDER BY ?WelshSpeakerPercentage