Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello 🙂
I need to 'sum' the operations of the last month, from a range of several years.
Example: from a range from August 2021 to today, only August 2022
fecha | ops |
03/08/2021 | 2 |
03/07/2022 | 6 |
04/08/2022 | 10 |
09/08/2022 | 12 |
It is similar to this but with month:
=Sum({<[fecha.autoCalendar.Year]={"$(=Year(max([fecha])))"},>} ops)
How can I add those operations?
Thank you!!!
2022 is the current year or perhaps from your model is it last year? if it's the former then the below expression is for the current year (2022) and the previous month (July).
=Sum({<[fecha.autoCalendar.Year]={"$(=Year(max([fecha])))"},[fecha.autoCalendar.Month]={$(=month(addmonths((max([fecha])),-1)))} >} ops)
Try this
=Sum({<[fecha.autoCalendar.Month]={$(=month(addmonths((max([fecha])),-1)))} >} ops)
Hello @BrunPierre
Maybe I haven't expressed it well. With this sentence it shows the previous month of all the years. But I need it to show is the last month (July), of the last year(2022).
Thank you!
2022 is the current year or perhaps from your model is it last year? if it's the former then the below expression is for the current year (2022) and the previous month (July).
=Sum({<[fecha.autoCalendar.Year]={"$(=Year(max([fecha])))"},[fecha.autoCalendar.Month]={$(=month(addmonths((max([fecha])),-1)))} >} ops)
It works, thank you!!!!!!!!!
I have made a small adjustment:
Sum({<[fecha.autoCalendar.Year]={"$(=Year(max([fecha])))"},[fecha.autoCalendar.Month]={"$(=month((max([fecha]))))"}>}ops)
Yes, I realised and edited, anyways happy to help!