Nested IF Problem "Invalid Number Of Arguements Passed"

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Nested IF Problem "Invalid Number Of Arguements Passed"

Postby gkeuler » Sat Apr 02, 2011 10:34 am

This is the format expression that creates the error, I know Ive got the IF,Then,Else synatax wrong somehow but only cause its producing an error. little help?

if (flg_blind_s,if (str_actions_p='F','Hero Open Fold',if (str_actions_p='C%','Hero Limped','Hero Open To',if (str_actions_p='','Villian Open Fold',if (flg_p_open_opp,'Villian Limped','Villian Open To')))))
gkeuler
 
Posts: 27
Joined: Fri Jan 29, 2010 5:17 am

Re: Nested IF Problem "Invalid Number Of Arguements Passed"

Postby gkeuler » Sat Apr 02, 2011 5:25 pm

N/M I guess, Im starting to figure it out

if (flg_blind_b AND str_actions_p='','V~Fold',if (flg_blind_b AND flg_p_face_raise,'V~Rz - ' + format_number( amt_p_raise_facing , 0 , false , false ),if(flg_blind_b AND flg_p_first_raise,'V~Limp', if (flg_blind_b AND flg_p_face_raise=false,'V~Limp','a'))))
gkeuler
 
Posts: 27
Joined: Fri Jan 29, 2010 5:17 am

Re: Nested IF Problem "Invalid Number Of Arguements Passed"

Postby kraada » Sun Apr 03, 2011 8:40 am

Good job - these things are tricky. Just remember each if() needs 3 things: the condition, what to do if it's true, and what to do otherwise. I also find it helpful sometimes to write these out in notepad and use indentation so I can more visually see what's happening at each level (then removing the whitespace before putting it back into PT3).
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests