Page 1 of 1

How to insert IF function in a variable/stat

PostPosted: Sat Aug 31, 2024 3:31 am
by rnieko
I made a custom stat to show adjusted tournament winnings including rakeback. It uses my custom variable:

(amt_won_adj - amt_buyin_ttl + amt_fee * 0.5)

This works fine but I want to enhance it further to use different rakeback % for different sites. So I try inserting IF function like this:

if( id_site_summary = 2400 ,
then (amt_won_adj - amt_buyin_ttl + amt_fee * 0.5),
else (amt_won_adj - amt_buyin_ttl + amt_fee * 0.2)
)

This is invalid expression already. I tried inserting IF in the stat itself and it's also invalid. How do I make this work correctly?

Also is this correct ID for WPN? And there's 2 columns "id_site_summary" and "id_site". Which one should I use?

Re: How to insert IF function in a variable/stat

PostPosted: Sun Sep 01, 2024 7:17 am
by Flag_Hippo
rnieko wrote:This is invalid expression already. I tried inserting IF in the stat itself and it's also invalid. How do I make this work correctly?

You will need to do the calculation in a column expression and there are examples of tournament rakeback statistics with their own colum expressions in the Download Warehouse.
rnieko wrote:Also is this correct ID for WPN? And there's 2 columns "id_site_summary" and "id_site". Which one should I use?

The ID is correct. In your column expression you should use:

Code: Select all
tourney_summary.id_site = 2400