Tricky Tab rendering criteria

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
I'm trying to figure out how to render a tab based on some tricky criteria. We have a tab that normally renders for "Yesterday's Transactions", which is pretty easy since I can just see whether rows are present in a model that is defined by "Transaction date = Yesterday".

What's tough is dealing with weekends. We never have transactions on Saturday or Sunday, so on Mondays I need a tab that shows the previous Friday's transactions. There doesn't seem to be an option for "Transaction date = n Days Ago" so I'm not sure how to build a model based on this.

"Transaction Date = last 3 days" would work, but I'd need to be able to hide the tab for every day except Monday.

Any help or ideas would be appreciated.

Thanks.
Photo of pFranzen

pFranzen

  • 222 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Nate Gilbertson

Nate Gilbertson

  • 1,194 Points 1k badge 2x thumb
Could you do rendering on something like Transaction = Last_N_Days: 3 and Transaction != Today? Since you don't have any transactions on Saturday or Sunday, this would only capture ones from last Friday. The tricky part is if there is ever a holiday on a Monday.

Photo of Nate Gilbertson

Nate Gilbertson

  • 1,194 Points 1k badge 2x thumb
One other to add to this. Transaction = Last_Week
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I think Nate is on to something. The model with those three conditions would only return results if today is Monday. So, you can set up the Monday tab to render when the model has rows. And you can set up the generic "yesterday" tab as you've already described.