I am assuming based on your explanation that you will only have one row returned per location/ID value. And if that is the case I also assume that you are GROUPing by Location and ID. If all that is true then perhaps something like this:
select location
,id
,case when count(*) = 1 then location else null end as Col1
,case when count(*) > 1 then count(*) else null end as Col2
from <yourTables>
group by location
,id
Be One with the Optimizer
TG