Hi @r_weber
Currently there is not an easy way of doing this
Revenue of this month
fetch bizevents, from: bin(now()-duration(getDayOfMonth(now())-1,unit:"d"),1d, at: -1h)
| summarize sum(amount)
revenue of last month
fetch bizevents,
from: totimestamp(if(formatTimestamp(now(), format:"M") == "1",
concat(getYear(now()) -1,"-12-01-01"), else: (concat(getYear(now()), "-",toLong(formatTimestamp(now(), format:"M"))-1, "-01-01")))),
to: bin(now()-duration(getDayOfMonth(now())-1,unit:"d"),1d, at: -1h)
| summarize sum(amount)
revenue of this week
fetch bizevents, from: bin(now()-duration(getDayOfWeek(now())-1,unit:"d"),1d, at: -1h)
| summarize sum(amount)
revenue of last week
fetch bizevents,
from: toTimestamp(concat(getYear(now()-7d), "-01-01"))
+ duration((getWeekOfYear(now()-7d)-1)*7+1, "d"),
to: bin(now()-duration(getDayOfWeek(now())-1,unit:"d"),1d, at: -1h)
| filter isNotNull(amount)
| summarize sum(amount)
revenue of last six month I think is also possible just with a more complex and nested usage of if function.
Best,
Sini