I have a table with a lot of cumulative columns, these columns reset to 0 at the end of each month. If I sum
this data, I'll end up double counting. Instead, With Hive, I'm trying to select the max date of each month.
I've tried this:
SELECT
yyyy_mm_dd,
id,
name,
cumulative_metric1,
cumulative_metric2
FROM
mytable
WHERE
yyyy_mm_dd = last_day(yyyy_mm_dd)
mytable
has daily data from the start of the year. In the output of the above, I only see the last date for January but not February. How can I select the last day of each month?