Sep 25, 2018 08:20 AM
Hi all,
I’m looking for a way to calculate a revenue prediction based on all records in a table.
Table 1: All orders, with a weeknumber
Table 2: Weeks, with linked orders and revenue. The revenue is rolled up as {Revenue} and the week is {Week}.
In Table 2, I’d like a field that sums up the revenue up to that week. So, record 12 (for week 12) should roll up all weeks before 12 but not those afterwards. Even nicer would be to roll up only the X weeks prior to {Week}.
I cannot get my head around how to roll up the revenue conditionally. Any suggestions would be very welcome.
Sep 25, 2018 08:56 AM
So you want a subtotal till the specific week of Table 2? And what about the average on the title? :thinking:
Sep 25, 2018 10:04 AM
There’s not an easy way to do this, since database tables have no concept of “records prior to this record” like a spreadsheet does.
I think you could try to do something like this:
1
, if not, a value of 0
Filter where Week 27 = 1
will show only records that have a value of 1
in the “Week 27” field, which should be records for weeks 1-27. Now the summary bar that sums or averages them all will show a “running” sum/avg up to that point.Sep 25, 2018 11:24 AM
As @Jeremy_Oglesby says, there’s no easy way to do this.
The difficult ways aren’t all that difficult, once you wrap your head around the process.
You can find some pointers here and here, as well as detailed instructions and sample code here. Don’t hesitate to ask if you have problems – it’s certainly nothing intuitive!