How can I find out how much profit my site is making?
You want to know your system's profit by redacting your users's returns from their initial investments.
select
ceil(sum(position_invested_amount)-sum(position_return_amount)) as Total_profit
from
( select
/*if (event_name="open_position" , position_invested_amount ,0) as position_invested_amount,
if (event_name="close_position", position_return_amount ,0) as position_return_amount
from cooladata
where date_range(context)
and (event_name="close_position" or event_name="open_position") */
position_invested_amount,
position_return_amount
from cooladata
where date_range(context)
and slicers(context)
and (event_name="close_position" )
and position_invested_amount is not null and position_invested_amount <>0
)