Location Cleanup

0

Please login or register to vote for this query.

(click on this box to dismiss)

Tridion Meta

Q&A about the site for Tridion developers and administrators

select Location, Cnt, CleanedLocation from
  (select Location, Cnt, 

  case 

    when Location like '%USA%' then 'USA'
    when Location like '%United States%' then 'USA'
    when Location like '%San Francisco%' then 'USA'
    when Location like '%India%' then 'India'
    when Location like '%Bangalore%' then 'India'
    when Location like '%Germany%' then 'Germany'
    when Location like '%China%' then 'China'
    when Location like '%France%' then 'France'
    when Location like '%United Kingdom%' then 'United Kingdom'
    when Location like '%London%' then 'United Kingdom'
    when Location like '%UK%' then 'United Kingdom'
    when Location like '%Philippines%' then 'Philippines'
    when Location like '%Indonesia%' then 'Indonesia'
    when Location like '%Singapore%' then 'Singapore'
    when Location like '%Pakistan%' then 'Pakistan'
    when Location like '%Canada%' then 'Canada'
    when Location like '%Israel%' then 'Israel'
    when Location like '%Russia%' then 'Russia'
    when Location like '%Netherlands%' then 'Netherlands'
    when Location like '%Egypt%' then 'Egypt'
    when Location like '%Bangladesh%' then 'Bangladesh'
    when Location like '%Brazil%' then 'Brazil'
    when Location like '%Brasil%' then 'Brazil'
    when Location like '%Iran%' then 'Iran'
    when Location like '%Poland%' then 'Poland'
    when Location like '%Australia%' then 'Australia'
    when Location like '%Ukraine%' then 'Ukraine'
    when Location like '%Vietnam%' then 'Vietnam'
    when Location like '%Việt Nam%' then 'Vietnam'
    when Location like '%Italy%' then 'Italy'
    when Location like '%Sweden%' then 'Sweden'
    when Location like '%Malaysia%' then 'Malaysia'
    when Location like '%Spain%' then 'Spain'
    when Location like '%Turkey%' then 'Turkey'
    when Location like '%Türkiye%' then 'Turkey'
    when Location like '%Việt Nam%' then 'Vietnam'
    when Location like '%Belgium%' then 'Belgium'
    when Location like '%Nigeria%' then 'Nigeria'
    when Location like '%Sri Lanka%' then 'Sri Lanka'
    when Location like '%Switzerland%' then 'Switzerland'
    when Location like '%Hong Kong%' then 'Hong Kong'
    when Location like '%South Africa%' then 'South Africa'
    when Location like '%Japan%' then 'Japan'
    when Location like '%Denmark%' then 'Denmark'
    when Location like '%Portugal%' then 'Portugal'
    when Location like '%Ireland%' then 'Ireland'
    when Location like '%Taiwan%' then 'Taiwan'
    when Location like '%Argentina%' then 'Argentina'
    when Location like '%china%' then 'China'
    when Location like '%Morocco%' then 'Morocco'
    when Location like '%Beijing%' then 'China'
    when Location like '%Seoul%' then 'South Korea'
    when Location like '%Korea%' then 'South Korea'
	when Location like '%Romania%' then 'Romania'
	when Location like '%Moscow%' then 'Russia'
	when Location like '%Madrid%' then 'Spain'
	when Location like '%Thailand%' then 'Thailand'
	when Location like '%Seattle%' then 'USA'
	when Location like '%California%' then 'USA'
	when Location like '%Kenya%' then 'Kenya'
	when Location like '%Italia%' then 'Italy'

    else 'null'
  end as CleanedLocation

  from
    (select Location, count(Location) as Cnt from Users where Location!='' group by Location) q1
) q2
where CleanedLocation='null'
order by Cnt desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results