0
I made this query in SQL in Bigquery (Google):
SELECT
FORMAT_DATE("%E4Y-%m", date) AS Mes,
cliente,
ARRAY_AGG( DISTINCT date ORDER BY date DESC LIMIT 2) AS date
FROM `iconic-rampart-279113.ranktank.IA_InternAll`
GROUP BY Mes, cliente
ORDER BY Mes, cliente ASC
It provides the last two dates of a month, that some customer has data, but would like to know how to fill in the blank values of the image.
Researching I found some queries with UNNEST but I did not understand, let alone know how to reproduce.
Or is there any other way to bring the data? (Month, client, date)