Error: Expression: Invalid number of functions

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Error: Expression: Invalid number of functions

Postby DOMIATED89 » Sat Jul 27, 2024 4:37 am

I'm making a custom column report and get a column error:

Error: Expression: Invalid number of functions passed to 'if' (Expecting 3, Returned 2).

Where is the issue:

Code: Select all
if[(cash_hand_player_statistics.flg_f_saw AND cash_hand_player_statistics.flg_f_has_position AND cash_hand_summary.cnt_players_f = 2 AND cash_hand_player_statistics.flg_p_3bet)
AND NOT
(cash_hand_player_statistics.flg_p_4bet or cash_hand_player_statistics.flg_p_4bet_def_opp)
AND NOT
(cash_hand_player_statistics.flg_p_squeeze or cash_hand_player_statistics.flg_p_squeeze_def_opp)
, 1, if[(cash_hand_player_statistics.flg_f_saw AND NOT (cash_hand_player_statistics.flg_f_has_position) AND cash_hand_summary.cnt_players_f = 2 AND cash_hand_player_statistics.flg_p_3bet)
AND NOT
(cash_hand_player_statistics.flg_p_4bet or cash_hand_player_statistics.flg_p_4bet_def_opp)
AND NOT
(cash_hand_player_statistics.flg_p_squeeze or cash_hand_player_statistics.flg_p_squeeze_def_opp)
, 2, if[(cash_hand_player_statistics.flg_f_saw AND cash_hand_player_statistics.flg_f_has_position AND cash_hand_summary.cnt_players_f = 2 AND cash_hand_player_statistics.flg_p_3bet_def_opp)
AND NOT
(cash_hand_player_statistics.flg_p_4bet or cash_hand_player_statistics.flg_p_4bet_def_opp)
AND NOT
(cash_hand_player_statistics.flg_p_squeeze or cash_hand_player_statistics.flg_p_squeeze_def_opp)
, 3, if[(cash_hand_player_statistics.flg_f_saw AND NOT (cash_hand_player_statistics.flg_f_has_position) AND cash_hand_summary.cnt_players_f = 2 AND cash_hand_player_statistics.flg_p_3bet_def_opp)
AND NOT
(cash_hand_player_statistics.flg_p_4bet or cash_hand_player_statistics.flg_p_4bet_def_opp)
AND NOT
(cash_hand_player_statistics.flg_p_squeeze or cash_hand_player_statistics.flg_p_squeeze_def_opp)
, 4, 5]]]]
DOMIATED89
 
Posts: 36
Joined: Sat Jun 29, 2024 3:52 am

Re: Error: Expression: Invalid number of functions

Postby Flag_Hippo » Sat Jul 27, 2024 6:22 am

What format expression are you using for the groupings in the custom statistic that is using this column?
Flag_Hippo
Moderator
 
Posts: 14953
Joined: Tue Jan 31, 2012 7:50 am

Re: Error: Expression: Invalid number of functions

Postby DOMIATED89 » Sun Jul 28, 2024 8:20 am

Flag_Hippo wrote:What format expression are you using for the groupings in the custom statistic that is using this column?


Code: Select all
if(this = 1, format('Aggressor HU IP'), if(this = 2, format('Aggressor HU OOP'), if(this = 3, format('Defending HU IP'), if(this = 4, format('Defending HU OOP'), if(this = 5, format('Other')))))
DOMIATED89
 
Posts: 36
Joined: Sat Jun 29, 2024 3:52 am

Re: Error: Expression: Invalid number of functions

Postby DOMIATED89 » Sun Jul 28, 2024 8:24 am

Apparently, i'm not missing a ")" at the end.
DOMIATED89
 
Posts: 36
Joined: Sat Jun 29, 2024 3:52 am

Re: Error: Expression: Invalid number of functions

Postby Flag_Hippo » Mon Jul 29, 2024 6:34 am

The expression needs a final ELSE condition. For example:

Code: Select all
if(this = 1, format('Aggressor HU IP'), if(this = 2, format('Aggressor HU OOP'), if(this = 3, format('Defending HU IP'), if(this = 4, format('Defending HU OOP'), format('Other')))))
Flag_Hippo
Moderator
 
Posts: 14953
Joined: Tue Jan 31, 2012 7:50 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: florent6001 and 9 guests

cron
highfalutin