Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
how can I create an expression that adds up the Sales of the last 10 workdays?
Here are some example data we work with:
Sales | Date | Workday |
500 | 25.09.2018 | 1 |
1000 | 26.09.2018 | 1 |
20 | 27.09.2018 | 0 |
0 | 28.09.2018 | 0 |
680 | 29.09.2018 | 1 |
700 | 30.09.2018 | 1 |
800 | 01.10.2018 | 1 |
700 | 02.10.2018 | 1 |
1000 | 03.10.2018 | 1 |
30 | 04.10.2018 | 0 |
5 | 05.10.2018 | 0 |
600 | 06.10.2018 | 1 |
If the date is a workday, there is a 1 in the field Workday. If not there is a 0 (holiday or weekend). So the whole thing needs to be dynamic.
I tried something like this, but it's not dynamic enough and could leave out some days:
sum( {1<
Workday={"1"},
Date={"$(=date(today()-1,'DD.MM.YY'))"},
Date={"$(=date(today()-2,'DD.MM.YY'))"},
Date={"$(=date(today()-3,'DD.MM.YY'))"},
Date={"$(=date(today()-4,'DD.MM.YY'))"},
Date={"$(=date(today()-5,'DD.MM.YY'))"},
Date={"$(=date(today()-6,'DD.MM.YY'))"},
Date={"$(=date(today()-7,'DD.MM.YY'))"},
Date={"$(=date(today()-8,'DD.MM.YY'))"},
Date={"$(=date(today()-9,'DD.MM.YY'))"},
Date={"$(=date(today()-10,'DD.MM.YY'))"}
>}
Sales)
Thanks!
Hello,
try this
=if(NetWorkDays(Date(Today())-10,Date(Date))>1,Sum(Sales),0)
Thanks
Raman Rastogi
Hello,
try this
=if(NetWorkDays(Date(Today())-10,Date(Date))>1,Sum(Sales),0)
Thanks
Raman Rastogi