HI Guys
i have some data and I am having difficulty creating a query to group the data by month year and then show current month value and the previous month value by city, example shown below
i have the below data
date | city | value |
---|---|---|
05/01/2021 | London | 25 |
11/01/2021 | London | 23 |
15/01/2021 | London | 22 |
25/01/2021 | leeds | 78 |
01/02/2021 | London | 12 |
02/02/2021 | leeds | 12 |
03/02/2021 | leeds | 12 |
i need a query which will return the below ( based on current month being February)
date | city | previous Value | Current Value |
---|---|---|---|
Feb-21 | London | 70 | 12 |
Feb-21 | Leeds | 78 | 24 |
can this be done?
thanks for any help provided