How to insert IF function in a variable/stat

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

How to insert IF function in a variable/stat

Postby rnieko » Sat Aug 31, 2024 3:31 am

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?
rnieko
 
Posts: 19
Joined: Fri Mar 29, 2013 6:32 am

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

Postby Flag_Hippo » Sun Sep 01, 2024 7:17 am

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
Flag_Hippo
Moderator
 
Posts: 15238
Joined: Tue Jan 31, 2012 7:50 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 20 guests

cron
highfalutin