I'm answering my own question. The result can be achieve using the following code:
select tp.Name,
sum(case when pub.Date between DATEADD(day, -31, getdate()) and DATEADD(day, -1, getdate())
then Impressions else 0 end) 'Last 30 days Impressions',
sum(case when pub.Date between DATEADD(day, -31, getdate()) and DATEADD(day, -1, getdate())
then (Revenue * rler.Rate) else 0 end) 'Last 30 days Revenues',
sum(case when pub.Date between DATEADD(day, -8, getdate()) and DATEADD(day, -1, getdate())
then Impressions else 0 end) 'Last 7 days Impressions',
sum(case when pub.Date between DATEADD(day, -8, getdate()) and DATEADD(day, -1, getdate())
then (Revenue * rler.Rate) else 0 end) 'Last 7 days Revenues',
sum(case when pub.Date between DATEADD(day, -4, getdate()) and DATEADD(day, -1, getdate())
then Impressions else 0 end) 'Last 3 days Impressions',
sum(case when pub.Date between DATEADD(day, -4, getdate()) and DATEADD(day, -1, getdate())
then (Revenue * rler.Rate) else 0 end) 'Last 3 days Revenues'
from ...
where ...
group by tp.Name, tp.Kind
order by 'Last 30 days Impressions' desc