I have the following query:
SELECT DISTINCT
Mes,
cliente,
Squad,
SUM(Trafego_Estimado) AS Trafego_Estimado
FROM `Ranktank.RT_BD`
GROUP BY Mes, cliente, Squad;
that returns me: *traffic varies on each line
Mes, client, Squad, Trafic
2020-11, A, UM, 15664.47
2020-10, B, DOIS, 15664.47
2020-09, C, TRES, 15664.47
2020-19, A, UM, 15664.47
2020-11, B, DOIS, 15664.47
2020-10, C, TRES, 15664.47
2020-10, A, UM, 15664.47
2020-09, B, DOIS, 15664.47
2020-11, C, TRES, 15664.47
I'm trying to streamline the spreadsheet with this structure like this:
Cliente, Squad, 2020-11, 2020-10, 2020-09
A, UM, 15664.47, 15664.47, 15664.47
B, DOIS, 15664.47, 15664.47, 15664.47
C, TRES, 15664.47, 15664.47, 15664.47
Is it possible to do that?
I tried to do it this way, but it didn't work: How to Pivot table in BigQuery