Stuck trying to get custom filter to work every day of the week

jgrossman
Participant I

I have a look that compares the daily revenue of each previous day compared to that day last week. I use the was in the last two weeks filter as well as this custom filter:

mod(diff_days(date(2008,01,01), now()) + 1, 7)>${transactions.transaction_day_of_week_index}

The issue is that on Monday if I run the custom filter I don’t get the perfect 7 day line up for the last two weeks. If however I remove the custom filter and just the standard was in the last two weeks filter the last 7 days line up perfectly. So to combat this I created a whole different dashboard that has this look with no custom filter that is scheduled to run just on Monday morning. What I want is to have code that would work every day even Monday. 

Can someone help write the above custom filter that will basically not use the custom filter if its Monday but do use the above custom filter if its any day but Monday? 

0 2 421
2 REPLIES 2

er1k
Participant V

What if you simply use the “last 14 complete days” as a filter and compare row value with value 7 rows below and show only the first 7 rows in viz?

jgrossman
Participant I

I was not successful in using the above suggestion. I guess what I am asking is how do I change up the custom filter so that if its Monday it does one comparison and if its any other day than Monday it does another. So far only two different reports have worked for me but I feel like this can be done in custom filter only?

Here are the filters that give me the correct visualization on Monday:

9392bb44-f6f6-4793-9513-eb4443e91121.jpg

Here is the correct Filter every other day of the week:

5e5a8eb7-2892-4b0f-bcfd-fbd243586a31.jpg

The point is to have a bar chart that shows only the sales for days up to that point in the week. The filter that does this on all days but Monday works great but on Monday if you run it you get an extra Monday. So what I am looking for is a single custom filter that works every day of the week and shows the results for up to that day compared to that day last week. So it should only show two weeks worth of data and on Monday have a full Monday - Sunday Line up.

b9a4731f-607b-4ba3-8919-a6ec485630d6.jpg
Top Labels in this Space
Top Solution Authors