Hello everyone,
Happy New Year!
So I had written a filter formula that filters data based on the result of a comparison between the number of the current month and that of last month.
This is an excerpt of my formula...
Filter(
colVoucherReportTable,
Switch(
dpd_Reports_PeriodOptions.Selected.Value,
"This Week",
WeekNum(Created) = WeekNum(Today()),
"Last Week",
WeekNum(Created) = WeekNum(Today() - 7),
"This Month",
Month(Created) = Month(Today()),
"Last Month",
Month(Created) = Month(Today()) - 1,
"This Quarter",
RoundUp(
Month(Created / 3),
0
) = RoundUp(
Month(Today()) / 3,
0
),
"Last Quarter",
RoundUp(
Month(Created / 3),
0
) = RoundUp(
Month(Today()) / 3,
0
) - 1,
"Specific Period",
Created >= dpc_Reports_StartDate.SelectedDate && Created <= dpc_Reports_EndDate.SelectedDate + 1
);
My problem now is that everything that is based on the Month() function returns blank.
If we look at Month(Created) = Month(Today()) - 1 for example, Month(Created) = 12 and Month(Today()) - 1 = 0 where I'm expecting 12. This worked fine last year, but obviously not in 2024 because we're in January (month 1). How can I solve this problem?
The filter based on WeekNum() seems fine. I hope there are no future problems there that I haven't discovered yet...Thank you.