Products revenue -> total revenue (sum of several data types)

Hi everyone,

I’m starting out with Bubble, and currently building a simple CRM system.

My database build as follows (only relevant things), so not all data is always completely loaded :

- User

- Deal
- Total Revenue (this should be sum of all products in Deal_Budget?)

- Deal_Budget
- Product A revenue
- Product B revenue
- Product C revenue
- Deal - Deal

I’d like to have one datatype for sum of all values (revenue) of Product A, B, C as a datatype, to make it easier to grab just the total revenue. Currently I am using “search for value of deal_budget is Product A + search for value of deal_budget is…” etc, which feels very scrubby.

Any ideas how I can manage this? And additional question: is this database formating the most logical for a pipedrive / sales CRM?

Thanks!

Welcome, Jasper!

About database structures, I would refer you to smarter minds @petter and @jj11 . I really like Petter’s concept of satellite types and data weight. You can get some ideas here: https://nocodedatabases.com/


So the data type Deal_Budget has 3 separate fields for each product (A, B, C)? You could separate that Product_Revenue in its own data type, something like:

Product_Revenue

  • Product (links to another type? Option set?)
  • Revenue – integer
  • Deal – Deal

Then you could add each Product_revenue to the Deal in a list field – Product_Revenue_list. Then you can just use an operator like Deal's Product_Revenue_list :each Revenue :sum. It should be speedy enough.

2 Likes

Thank you Rico, this helped me alot! Been trying it out in the past half hour, and it works pretty well. The structure feels much more intuitive.

Appreciate your help.

2 Likes