5 Replies Latest reply: Jun 12, 2013 2:39 PM by matthew thompson RSS

    Sum sales last weekday

      Hi,

       

      I've been trying to write an expression to sum sales over the last weekday. So on Tuesday, I need to have the sum of all sales on Monday, etc. If I use the following set, I can sum Monday's sales:

       

      Sum({<[Calendar Day Name] = {"Monday"} >} _f_OK_SIGNUP)

       

      However, I cannot figure out how to create a dynamic set using the weekday function to sum the last weekday's sales. I've tried quite a few variations without success. Here's one:

       

      sum({<[Calendar Day Name] = {"$(=num(weekday(today()-1))"} >} _f_OK_SIGNUP)

       

      If I place =num(weekday(today(0)-1)) in a textbox it retruns 0, which is Monday, so I would have expected this to work.

       

      Any help would be much appreciated.

       

      Matt