I have a workflow that feeds into a dashboard I completed last month and it was working fine. The workflow runs every month. It ran this month (January) and the dashboard was blank. When I check the workflow this custom filter I have is no longer working? The True is blank (returns 0 records).
The custom filter is below. Basically the formula says if the month of today's date is January then return November of last year's data. If it's February then return December of last year, otherwise give me the data from the month that is two months ago from today's month.
The filter is this:
IF DateTimeMonth(DateTimeToday()) = 1 THEN
(DateTimeYear([SalesDate]) = DateTimeYear(DateTimeToday())-1)
AND
(DateTimeMonth([SalesDate]) = DateTimeMonth(DateTimeToday())-2)
ELSEIF DateTimeMonth(DateTimeToday()) = 2 THEN
(DateTimeYear([SalesDate]) = DateTimeYear(DateTimeToday())-1)
AND
(DateTimeMonth([SalesDate]) = DateTimeMonth(DateTimeToday())-2)
ELSE
(DateTimeYear([SalesDate]) = DateTimeYear(DateTimeToday()))
AND
(DateTimeMonth([SalesDate]) = DateTimeMonth(DateTimeToday())-2)
ENDIF
I can't see what's going wrong. Any help is much appreciated!
Solved! Go to Solution.
Hey @Crispy131, for this part of your statement:
(DateTimeMonth([SalesDate]) = DateTimeMonth(DateTimeToday())-2)
In January/February, DateTimeMonth - 2 will return a result of -1 and 0 respectively as you’re taking 2 away from the month number (1 and 2). Therefore you should change this part to DateTimeMonth([SalesDate]) = 11 for January, and
DateTimeMonth([SalesDate]) = 12 for February, leaving out the subtraction of DateTimeToday’s month.
You legend! Thank you so much such an easy fix I was overthinking it. Thank you!
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |