Hello!
I am trying to build a table with the following format
YEAR_MONTH | SALES | LAST_YEAR_SALES |
OUT 2021 | 60 | 40 |
NOV 2021 | 50 | 30 |
DEC 2021 | 20 | 40 |
JAN 2022 | 10 | 10 |
Where "YEAR_MONTH" is a dimension and SALES is SUM(SALES)
How do i create the "Last Year Sales" columns? I think i would need to perform some kind of set analysis based on the table's dimension. How could i do that, knowing that YEAR_MONTH is a string?
I think firstly you need to add the date field in the data - convert the string into a date.
Date(Date#(YEAR_MONTH,'MMM YYYY')) as SalesDate