Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Could anyone help me, I'm trying to do an action to select the current year and the very last month that contains data from the corresponding year.
I thank you.
Hi,
You can use below Expressions :
Set Analysis :
sum( {$< Year_Cost = {$(#=Year(today())-1),$(#=Year(today()))} , Month_Cost = {$(=Month(AddMonths(Today(),-1)))} >} Value)
General Condition:
=Sum(
if(Month(Date) = Month(today())-1
and
(Year(Date) = Year(today()) or Year(Date) = Year(today())-1),
Value))
Both the expressions provide result for previous month and Current , Previous Year
Thanks for the quick response, but you do not understand, for the year really need to get the current, but for months, as the base is not updated constantly, I need to catch the last months that have data. For example, the current month is July where we are, but based on last month is May.
Create a button with two "Select in Field" actions in it for Year and Month fields from your Calendar table.
For Year field use this:
=year(today())
For Month field use this:
=month(addmonths(yearstart(today()) , (max({1 <Year={"$(=year(today()))"}>} Month) - 1)))
Take a look at an example from attachment